diff options
| author | Paul Eggert | 2012-09-10 19:28:27 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-09-10 19:28:27 -0700 |
| commit | c990426a9883c1bd1782e6b117184b654eecda67 (patch) | |
| tree | 43083f890e5286637ee754482af0f92d6d2236d0 /admin | |
| parent | 6fda35f2b3e3ce3c7dcc05f230f60c51c4c42e60 (diff) | |
| download | emacs-c990426a9883c1bd1782e6b117184b654eecda67.tar.gz emacs-c990426a9883c1bd1782e6b117184b654eecda67.zip | |
Simplify, document, and port floating-point.
The porting part of this patch fixes bugs on non-IEEE platforms
with frexp, ldexp, logb.
* admin/CPP-DEFINES (HAVE_CBRT, HAVE_LOGB, logb): Remove.
* configure.ac (logb, cbrt): Do not check for these functions,
as they are not being used.
* doc/lispref/numbers.texi (Float Basics, Arithmetic Operations, Math Functions):
Document that / and mod (with floating point arguments), along
with asin, acos, log, log10, expt and sqrt, return special values
instead of signaling exceptions.
(Float Basics): Document that logb operates on the absolute value
of its argument.
(Math Functions): Document that (log ARG BASE) also returns NaN if
BASE is negative. Document that (expt X Y) returns NaN if X is a
finite negative number and Y a finite non-integer.
* etc/NEWS: Document NaNs versus signaling-error change.
* src/data.c, src/lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
Now static.
* src/floatfns.c: Simplify discussion of functions that Emacs doesn't
support, by removing commented-out code and briefly listing the
C89 functions excluded. The commented-out stuff was confusing
maintenance, e.g., we thought we needed cbrt but it was commented out.
(logb): Remove decl; no longer needed.
(isfinite): New macro, if not already supplied.
(isnan): Don't replace any existing macro.
(Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
are present on all C89 platforms.
(Ffrexp): Do not special-case zero, as frexp does the right thing
for that case.
(Flogb): Do not use logb, as it doesn't have the desired meaning
on hosts that use non-base-2 floating point. Instead, stick with
frexp, which is C89 anyway. Do not pass an infinity or a NaN to
frexp, to avoid getting an unspecified result.
Diffstat (limited to 'admin')
| -rw-r--r-- | admin/CPP-DEFINES | 4 | ||||
| -rw-r--r-- | admin/ChangeLog | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/admin/CPP-DEFINES b/admin/CPP-DEFINES index b40ba78e20d..cf6ffee2c63 100644 --- a/admin/CPP-DEFINES +++ b/admin/CPP-DEFINES | |||
| @@ -120,7 +120,6 @@ HAVE_ATTRIBUTE_ALIGNED | |||
| 120 | HAVE_BDFFONT | 120 | HAVE_BDFFONT |
| 121 | HAVE_BOXES | 121 | HAVE_BOXES |
| 122 | HAVE_C99_STRTOLD | 122 | HAVE_C99_STRTOLD |
| 123 | HAVE_CBRT | ||
| 124 | HAVE_CFMAKERAW | 123 | HAVE_CFMAKERAW |
| 125 | HAVE_CFSETSPEED | 124 | HAVE_CFSETSPEED |
| 126 | HAVE_CLOCK_GETTIME | 125 | HAVE_CLOCK_GETTIME |
| @@ -251,7 +250,6 @@ HAVE_LIBXMU | |||
| 251 | HAVE_LINUX_VERSION_H | 250 | HAVE_LINUX_VERSION_H |
| 252 | HAVE_LOCALTIME_R | 251 | HAVE_LOCALTIME_R |
| 253 | HAVE_LOCAL_SOCKETS | 252 | HAVE_LOCAL_SOCKETS |
| 254 | HAVE_LOGB | ||
| 255 | HAVE_LONG_FILE_NAMES | 253 | HAVE_LONG_FILE_NAMES |
| 256 | HAVE_LONG_LONG_INT | 254 | HAVE_LONG_LONG_INT |
| 257 | HAVE_LRAND48 | 255 | HAVE_LRAND48 |
| @@ -574,7 +572,6 @@ getpid | |||
| 574 | isatty | 572 | isatty |
| 575 | kill | 573 | kill |
| 576 | link | 574 | link |
| 577 | logb | ||
| 578 | lseek | 575 | lseek |
| 579 | mkdir | 576 | mkdir |
| 580 | mktemp | 577 | mktemp |
| @@ -616,7 +613,6 @@ fopen | |||
| 616 | getpid | 613 | getpid |
| 617 | index | 614 | index |
| 618 | isatty | 615 | isatty |
| 619 | logb | ||
| 620 | lseek | 616 | lseek |
| 621 | mkdir | 617 | mkdir |
| 622 | mktemp | 618 | mktemp |
diff --git a/admin/ChangeLog b/admin/ChangeLog index 2c61f437981..b70067d7465 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-09-11 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Simplify, document, and port floating-point (Bug#12381). | ||
| 4 | * CPP-DEFINES (HAVE_CBRT, HAVE_LOGB, logb): Remove. | ||
| 5 | |||
| 1 | 2012-09-09 Paul Eggert <eggert@cs.ucla.edu> | 6 | 2012-09-09 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 7 | ||
| 3 | Assume C89 or later for math functions (Bug#12381). | 8 | Assume C89 or later for math functions (Bug#12381). |