This change reverts the previous one, and then goes about closing bug 176
in a different way. Namely, by changing Vpi from being a
DEFVAR_CONST_LISP to a DEFVAR_LISP. IOW, a plain ordinary variable.
* src/ent/ent-mpfr.c (vars_of_ent_mpfr): Set Vpi to be a normal
lisp variable instead of a constant so packages like Calc can
let-bind them for their own evil and misguided purposes. :-)
Vbigfr_pi -> Vpi
* src/ent/ent-mpfr.h: Vbigfr_pi -> Vpi
* lisp/float-sup.el: Revert previous change.
Signed-off-by: Steve Youngs <steve@sxemacs.org>
(error "Floating point was disabled at compile time"))
;; define pi and e via math-lib calls. (much less prone to killer typos.)
(error "Floating point was disabled at compile time"))
;; define pi and e via math-lib calls. (much less prone to killer typos.)
-(if (featurep 'bigfr)
- (progn
- (defconst pi bigfr-pi "The value of Pi (3.1415926...)")
- (defconst e euler "The value of e (2.7182818...)"))
+(unless (featurep 'bigfr)
(defconst pi (* 4 (atan 1)) "The value of Pi (3.1415926...)")
(defconst e (exp 1) "The value of e (2.7182818...)"))
(defconst pi (* 4 (atan 1)) "The value of Pi (3.1415926...)")
(defconst e (exp 1) "The value of e (2.7182818...)"))
\f
Lisp_Object Veuler;
Lisp_Object Veuler_mascheroni;
\f
Lisp_Object Veuler;
Lisp_Object Veuler_mascheroni;
bigfr ent_scratch_bigfr;
static ase_nullary_operation_f Qent_mpfr_zero, Qent_mpfr_one;
bigfr ent_scratch_bigfr;
static ase_nullary_operation_f Qent_mpfr_zero, Qent_mpfr_one;
Veuler_mascheroni = make_bigfr(0.0, 2048UL);
mpfr_const_euler(XBIGFR_DATA(Veuler_mascheroni), GMP_RNDN);
Veuler_mascheroni = make_bigfr(0.0, 2048UL);
mpfr_const_euler(XBIGFR_DATA(Veuler_mascheroni), GMP_RNDN);
- Vbigfr_pi = make_bigfr(0.0, 2048UL);
- mpfr_const_pi(XBIGFR_DATA(Vbigfr_pi), GMP_RNDN);
+ Vpi = make_bigfr(0.0, 2048UL);
+ mpfr_const_pi(XBIGFR_DATA(Vpi), GMP_RNDN);
}
void syms_of_ent_mpfr(void)
}
void syms_of_ent_mpfr(void)
/* just some dummy values atm, to make the dumper smile */
Veuler = make_int(1L);
Veuler_mascheroni = make_int(1L);
/* just some dummy values atm, to make the dumper smile */
Veuler = make_int(1L);
Veuler_mascheroni = make_int(1L);
- Vbigfr_pi = make_int(1L);
DEFVAR_CONST_LISP("euler", &Veuler /*
The value of Euler's constant e (2.7182818...).
DEFVAR_CONST_LISP("euler", &Veuler /*
The value of Euler's constant e (2.7182818...).
DEFVAR_CONST_LISP("euler-mascheroni", &Veuler_mascheroni /*
The value of the Euler-Mascheroni constant (0.5772156...).
*/);
DEFVAR_CONST_LISP("euler-mascheroni", &Veuler_mascheroni /*
The value of the Euler-Mascheroni constant (0.5772156...).
*/);
- DEFVAR_CONST_LISP("bigfr-pi", &Vbigfr_pi /*
+ /*
+ * See http://issues.sxemacs.org/show_bug.cgi?id=176 for why this
+ * is no longer a constant. -SY.
+ */
+ DEFVAR_LISP("pi", &Vpi /*
The value of pi (3.1415926...).
*/);
The value of pi (3.1415926...).
*/);
extern Lisp_Object Veuler;
extern Lisp_Object Veuler_mascheroni;
extern Lisp_Object Veuler;
extern Lisp_Object Veuler_mascheroni;
-extern Lisp_Object Vbigfr_pi;
\f
typedef struct Lisp_Bigfr Lisp_Bigfr;
\f
typedef struct Lisp_Bigfr Lisp_Bigfr;