# HG changeset patch # User james # Date 1083351554 0 # Node ID a7dd0aed0fe62d0c136dbb174fc845c85cec72e7 # Parent a741f294362b6a0dfb63f4310a0d385fced8324a [xemacs-hg @ 2004-04-30 18:59:11 by james] Fix bigfloat-max-prec initialization. diff -r a741f294362b -r a7dd0aed0fe6 src/ChangeLog --- a/src/ChangeLog Fri Apr 30 14:59:17 2004 +0000 +++ b/src/ChangeLog Fri Apr 30 18:59:14 2004 +0000 @@ -1,3 +1,10 @@ +2004-04-30 Jerry James + + * number.c (vars_of_number): Fix comment. Initialize + bigfloat-max-prec when it is possible to do so safely. + * number.c (init_number): If bigfloat-max-prec is a bignum, set it + only when initialized. + 2004-04-19 Jerry James * data.c (sign_extend_lisp_int): Use INT_VALBITS instead of diff -r a741f294362b -r a7dd0aed0fe6 src/number.c --- a/src/number.c Fri Apr 30 14:59:17 2004 +0000 +++ b/src/number.c Fri Apr 30 18:59:14 2004 +0000 @@ -748,8 +748,8 @@ void vars_of_number (void) { - /* This variable is a Lisp variable rather than a number variable so that we - can put bignums in it. */ + /* These variables are Lisp variables rather than number variables so that + we can put bignums in them. */ DEFVAR_LISP_MAGIC ("default-float-precision", &Vdefault_float_precision, /* The default floating-point precision for newly created floating point values. This should be 0 for the precision of the machine-supported floating point @@ -763,6 +763,13 @@ This is currently the value of ULONG_MAX on the target machine. */); + /* See init_number for the other half of Vbigfloat_max_prec initialization */ +#if defined(HAVE_BIGFLOAT) && !defined(HAVE_BIGNUM) + Vbigfloat_max_prec = make_int (EMACS_INT_MAX); +#else + Vbigfloat_max_prec = make_int (0); +#endif /* HAVE_BIGFLOAT */ + DEFVAR_CONST_INT ("most-negative-fixnum", &Vmost_negative_fixnum /* The fixnum closest in value to negative infinity. */); @@ -799,11 +806,6 @@ init_number_mp (); #endif -#if defined(BIGNUM) && defined(BIGFLOAT) - Vbigfloat_max_prec = make_bignum (0L); - bignum_set_ulong (XBIGNUM_DATA (Vbigfloat_max_prec), ULONG_MAX); -#endif - #ifdef HAVE_BIGNUM bignum_init (scratch_bignum); bignum_init (scratch_bignum2); @@ -818,4 +820,13 @@ bigfloat_init (scratch_bigfloat2); #endif } + +#if defined(HAVE_BIGFLOAT) && defined(HAVE_BIGNUM) + /* Avoid dumping a bignum */ + if (initialized) + { + Vbigfloat_max_prec = make_bignum (0L); + bignum_set_ulong (XBIGNUM_DATA (Vbigfloat_max_prec), ULONG_MAX); + } +#endif }