]> git.eshelyaron.com Git - emacs.git/commit
Fix bugs when rounding to bignums
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 23 Aug 2018 02:30:24 +0000 (19:30 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 23 Aug 2018 02:30:57 +0000 (19:30 -0700)
commitee641b87cf220250ba89f219fb47a4406a05deb7
tree08ff44c5197ae39b2ec0906de4bb4dcafda4677f
parentbe5fe6183e95f3afe3a62ec43504b99df90bc794
Fix bugs when rounding to bignums

Also, since Emacs historically reported a range error when
rounding operations overflowed, do that consistently for all
bignum overflows.
* doc/lispref/errors.texi (Standard Errors):
* doc/lispref/numbers.texi (Integer Basics): Document range errors.
* src/alloc.c (range_error): Rename from integer_overflow.
All uses changed.
* src/floatfns.c (rounding_driver): When the result of a floating
point rounding operation does not fit into a fixnum, put it
into a bignum instead of always signaling an range error.
* test/src/floatfns-tests.el (divide-extreme-sign):
These tests now return the mathematically-correct answer
instead of signaling an error.
(bignum-round): Check that integers round to themselves.
doc/lispref/errors.texi
doc/lispref/numbers.texi
src/alloc.c
src/data.c
src/floatfns.c
src/lisp.h
test/src/floatfns-tests.el