summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2012-09-10 19:28:27 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2012-09-10 19:28:27 -0700
commitc990426a9883c1bd1782e6b117184b654eecda67 (patch)
tree43083f890e5286637ee754482af0f92d6d2236d0 /configure.ac
parent6fda35f2b3e3ce3c7dcc05f230f60c51c4c42e60 (diff)
downloademacs-c990426a9883c1bd1782e6b117184b654eecda67.tar.gz
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 'configure.ac')
-rw-r--r--configure.ac6
1 files changed, 3 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 97e967d8043..9491c1da8d5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2689,8 +2689,8 @@ if test $emacs_cv_netdb_declares_h_errno = yes; then
AC_DEFINE(HAVE_H_ERRNO, 1, [Define to 1 if netdb.h declares h_errno.])
fi
-# fmod, logb, and frexp are found in -lm on most systems.
-# On HPUX 9.01, -lm does not contain logb, so check for sqrt.
+# sqrt and other floating-point functions such as fmod and frexp
+# are found in -lm on most systems.
AC_CHECK_LIB(m, sqrt)
# Check for mail-locking functions in a "mail" library. Probably this should
@@ -2770,7 +2770,7 @@ AC_SUBST(BLESSMAIL_TARGET)
AC_CHECK_FUNCS(gethostname \
closedir getrusage get_current_dir_name \
-lrand48 logb cbrt setsid \
+lrand48 setsid \
fpathconf select euidaccess getpagesize setlocale \
utimes getrlimit setrlimit setpgid getcwd shutdown getaddrinfo \
__fpending strsignal setitimer \