Mercurial > hg > xemacs-beta
changeset 2051:a7dd0aed0fe6
[xemacs-hg @ 2004-04-30 18:59:11 by james]
Fix bigfloat-max-prec initialization.
author | james |
---|---|
date | Fri, 30 Apr 2004 18:59:14 +0000 |
parents | a741f294362b |
children | 2998991c1d2f |
files | src/ChangeLog src/number.c |
diffstat | 2 files changed, 25 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- 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 <james@xemacs.org> + + * 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 <james@xemacs.org> * data.c (sign_extend_lisp_int): Use INT_VALBITS instead of
--- 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 }