summaryrefslogtreecommitdiff
path: root/src/lisp.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2019-11-13 13:07:01 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2019-11-13 13:10:09 -0800
commitbede5984246ba734c93fc28148b5f8e1b14d30c5 (patch)
treed5ec0482e1ed6b8dad42e65c9d9ea4eb2e2b75ff /src/lisp.h
parent02e637ecca3b1419d2a6c433eca72c5728c65051 (diff)
downloademacs-bede5984246ba734c93fc28148b5f8e1b14d30c5.tar.gz
Fix double-rounding bug in ceiling etc.
This is doable now that we have bignums. * src/floatfns.c (integer_value): Remove; no longer used. (rescale_for_division): New function. (rounding_driver): Use it to divide properly (by using bignums) even when arguments are float, fixing a double-rounding FIXME. * src/lisp.h (LOG2_FLT_RADIX): Move here ... * src/timefns.c (frac_to_double): ... from here. * test/src/floatfns-tests.el (big-round): Add a test to catch the double-rounding bug.
Diffstat (limited to 'src/lisp.h')
-rw-r--r--src/lisp.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lisp.h b/src/lisp.h
index 38e1891c894..1d25add9287 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3684,6 +3684,8 @@ extern Lisp_Object string_make_unibyte (Lisp_Object);
extern void syms_of_fns (void);
/* Defined in floatfns.c. */
+verify (FLT_RADIX == 2 || FLT_RADIX == 16);
+enum { LOG2_FLT_RADIX = FLT_RADIX == 2 ? 1 : 4 };
int double_integer_scale (double);
#ifndef HAVE_TRUNC
extern double trunc (double);