diff options
| author | Stefan Monnier | 2011-03-21 12:42:16 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2011-03-21 12:42:16 -0400 |
| commit | cafdcef32d55cbb44389d7e322e7f973cbb72dfd (patch) | |
| tree | 7ee0c41ea8a589650ce6f4311fb10e61a63807b9 /src/floatfns.c | |
| parent | a08a25d7aaf251aa18f2ef747be53734bc55cae9 (diff) | |
| parent | 4e05e67e4cd0bc1b0a4ef3176a4d0d91c6b3738e (diff) | |
| download | emacs-cafdcef32d55cbb44389d7e322e7f973cbb72dfd.tar.gz emacs-cafdcef32d55cbb44389d7e322e7f973cbb72dfd.zip | |
Merge from trunk
Diffstat (limited to 'src/floatfns.c')
| -rw-r--r-- | src/floatfns.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/floatfns.c b/src/floatfns.c index c00923643d1..bc03509b757 100644 --- a/src/floatfns.c +++ b/src/floatfns.c | |||
| @@ -187,8 +187,10 @@ static const char *float_error_fn_name; | |||
| 187 | xsignal3 (Qrange_error, build_string ((op)), (a1), (a2)) | 187 | xsignal3 (Qrange_error, build_string ((op)), (a1), (a2)) |
| 188 | #define domain_error(op,arg) \ | 188 | #define domain_error(op,arg) \ |
| 189 | xsignal2 (Qdomain_error, build_string ((op)), (arg)) | 189 | xsignal2 (Qdomain_error, build_string ((op)), (arg)) |
| 190 | #ifdef FLOAT_CHECK_DOMAIN | ||
| 190 | #define domain_error2(op,a1,a2) \ | 191 | #define domain_error2(op,a1,a2) \ |
| 191 | xsignal3 (Qdomain_error, build_string ((op)), (a1), (a2)) | 192 | xsignal3 (Qdomain_error, build_string ((op)), (a1), (a2)) |
| 193 | #endif | ||
| 192 | 194 | ||
| 193 | /* Extract a Lisp number as a `double', or signal an error. */ | 195 | /* Extract a Lisp number as a `double', or signal an error. */ |
| 194 | 196 | ||
| @@ -326,9 +328,9 @@ If X is zero, both parts (SGNFCAND and EXP) are zero. */) | |||
| 326 | return Fcons (make_float (0.0), make_number (0)); | 328 | return Fcons (make_float (0.0), make_number (0)); |
| 327 | else | 329 | else |
| 328 | { | 330 | { |
| 329 | int exp; | 331 | int exponent; |
| 330 | double sgnfcand = frexp (f, &exp); | 332 | double sgnfcand = frexp (f, &exponent); |
| 331 | return Fcons (make_float (sgnfcand), make_number (exp)); | 333 | return Fcons (make_float (sgnfcand), make_number (exponent)); |
| 332 | } | 334 | } |
| 333 | } | 335 | } |
| 334 | 336 | ||
| @@ -336,10 +338,10 @@ DEFUN ("ldexp", Fldexp, Sldexp, 1, 2, 0, | |||
| 336 | doc: /* Construct number X from significand SGNFCAND and exponent EXP. | 338 | doc: /* Construct number X from significand SGNFCAND and exponent EXP. |
| 337 | Returns the floating point value resulting from multiplying SGNFCAND | 339 | Returns the floating point value resulting from multiplying SGNFCAND |
| 338 | (the significand) by 2 raised to the power of EXP (the exponent). */) | 340 | (the significand) by 2 raised to the power of EXP (the exponent). */) |
| 339 | (Lisp_Object sgnfcand, Lisp_Object exp) | 341 | (Lisp_Object sgnfcand, Lisp_Object exponent) |
| 340 | { | 342 | { |
| 341 | CHECK_NUMBER (exp); | 343 | CHECK_NUMBER (exponent); |
| 342 | return make_float (ldexp (XFLOATINT (sgnfcand), XINT (exp))); | 344 | return make_float (ldexp (XFLOATINT (sgnfcand), XINT (exponent))); |
| 343 | } | 345 | } |
| 344 | #endif | 346 | #endif |
| 345 | 347 | ||
| @@ -1037,7 +1039,7 @@ syms_of_floatfns (void) | |||
| 1037 | defsubr (&Scopysign); | 1039 | defsubr (&Scopysign); |
| 1038 | defsubr (&Sfrexp); | 1040 | defsubr (&Sfrexp); |
| 1039 | defsubr (&Sldexp); | 1041 | defsubr (&Sldexp); |
| 1040 | #endif | 1042 | #endif |
| 1041 | #if 0 | 1043 | #if 0 |
| 1042 | defsubr (&Sacosh); | 1044 | defsubr (&Sacosh); |
| 1043 | defsubr (&Sasinh); | 1045 | defsubr (&Sasinh); |
| @@ -1074,4 +1076,3 @@ syms_of_floatfns (void) | |||
| 1074 | defsubr (&Sround); | 1076 | defsubr (&Sround); |
| 1075 | defsubr (&Struncate); | 1077 | defsubr (&Struncate); |
| 1076 | } | 1078 | } |
| 1077 | |||