Mercurial > hg > xemacs-beta
comparison src/number.c @ 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 | 4db90be29229 |
children | 471242c84954 |
comparison
equal
deleted
inserted
replaced
2050:a741f294362b | 2051:a7dd0aed0fe6 |
---|---|
746 } | 746 } |
747 | 747 |
748 void | 748 void |
749 vars_of_number (void) | 749 vars_of_number (void) |
750 { | 750 { |
751 /* This variable is a Lisp variable rather than a number variable so that we | 751 /* These variables are Lisp variables rather than number variables so that |
752 can put bignums in it. */ | 752 we can put bignums in them. */ |
753 DEFVAR_LISP_MAGIC ("default-float-precision", &Vdefault_float_precision, /* | 753 DEFVAR_LISP_MAGIC ("default-float-precision", &Vdefault_float_precision, /* |
754 The default floating-point precision for newly created floating point values. | 754 The default floating-point precision for newly created floating point values. |
755 This should be 0 for the precision of the machine-supported floating point | 755 This should be 0 for the precision of the machine-supported floating point |
756 type (the C double type), or an unsigned integer no greater than | 756 type (the C double type), or an unsigned integer no greater than |
757 bigfloat-max-prec (currently the size of a C unsigned long). | 757 bigfloat-max-prec (currently the size of a C unsigned long). |
761 DEFVAR_CONST_LISP ("bigfloat-max-prec", &Vbigfloat_max_prec /* | 761 DEFVAR_CONST_LISP ("bigfloat-max-prec", &Vbigfloat_max_prec /* |
762 The maximum number of bits of precision a bigfloat can have. | 762 The maximum number of bits of precision a bigfloat can have. |
763 This is currently the value of ULONG_MAX on the target machine. | 763 This is currently the value of ULONG_MAX on the target machine. |
764 */); | 764 */); |
765 | 765 |
766 /* See init_number for the other half of Vbigfloat_max_prec initialization */ | |
767 #if defined(HAVE_BIGFLOAT) && !defined(HAVE_BIGNUM) | |
768 Vbigfloat_max_prec = make_int (EMACS_INT_MAX); | |
769 #else | |
770 Vbigfloat_max_prec = make_int (0); | |
771 #endif /* HAVE_BIGFLOAT */ | |
772 | |
766 DEFVAR_CONST_INT ("most-negative-fixnum", &Vmost_negative_fixnum /* | 773 DEFVAR_CONST_INT ("most-negative-fixnum", &Vmost_negative_fixnum /* |
767 The fixnum closest in value to negative infinity. | 774 The fixnum closest in value to negative infinity. |
768 */); | 775 */); |
769 Vmost_negative_fixnum = EMACS_INT_MIN; | 776 Vmost_negative_fixnum = EMACS_INT_MIN; |
770 | 777 |
797 #endif | 804 #endif |
798 #ifdef WITH_MP | 805 #ifdef WITH_MP |
799 init_number_mp (); | 806 init_number_mp (); |
800 #endif | 807 #endif |
801 | 808 |
802 #if defined(BIGNUM) && defined(BIGFLOAT) | 809 #ifdef HAVE_BIGNUM |
810 bignum_init (scratch_bignum); | |
811 bignum_init (scratch_bignum2); | |
812 #endif | |
813 | |
814 #ifdef HAVE_RATIO | |
815 ratio_init (scratch_ratio); | |
816 #endif | |
817 | |
818 #ifdef HAVE_BIGFLOAT | |
819 bigfloat_init (scratch_bigfloat); | |
820 bigfloat_init (scratch_bigfloat2); | |
821 #endif | |
822 } | |
823 | |
824 #if defined(HAVE_BIGFLOAT) && defined(HAVE_BIGNUM) | |
825 /* Avoid dumping a bignum */ | |
826 if (initialized) | |
827 { | |
803 Vbigfloat_max_prec = make_bignum (0L); | 828 Vbigfloat_max_prec = make_bignum (0L); |
804 bignum_set_ulong (XBIGNUM_DATA (Vbigfloat_max_prec), ULONG_MAX); | 829 bignum_set_ulong (XBIGNUM_DATA (Vbigfloat_max_prec), ULONG_MAX); |
805 #endif | |
806 | |
807 #ifdef HAVE_BIGNUM | |
808 bignum_init (scratch_bignum); | |
809 bignum_init (scratch_bignum2); | |
810 #endif | |
811 | |
812 #ifdef HAVE_RATIO | |
813 ratio_init (scratch_ratio); | |
814 #endif | |
815 | |
816 #ifdef HAVE_BIGFLOAT | |
817 bigfloat_init (scratch_bigfloat); | |
818 bigfloat_init (scratch_bigfloat2); | |
819 #endif | |
820 } | 830 } |
821 } | 831 #endif |
832 } |