Round bignums consistently with other integers
commit0b36041d2a528419982a19940573783ff318c0d4
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 22 Sep 2018 15:59:06 +0000 (22 08:59 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 22 Sep 2018 16:01:26 +0000 (22 09:01 -0700)
tree0b66b534356f9e4ed7cb39601f6d29492cbea104
parent596ccc087c8f844f81b075da643e5c554a8de9d6
Round bignums consistently with other integers

* src/bignum.c (mpz_bufsize): New function.
(bignum_bufsize): Use it.
(mpz_get_d_rounded): New function.
(bignum_to_double): Use it.
* src/bignum.c (bignum_to_double):
* src/data.c (bignum_arith_driver):
When converting bignums to double, round instead of
truncating, to be consistent with what happens with fixnums.
* test/src/floatfns-tests.el (bignum-to-float): Test rounding.
src/bignum.c
src/bignum.h
src/data.c
test/src/floatfns-tests.el