]> git.eshelyaron.com Git - emacs.git/commit
Improve (format "%g" bignum) precision
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 28 Aug 2018 18:59:21 +0000 (11:59 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 28 Aug 2018 19:00:20 +0000 (12:00 -0700)
commitd4586b7a9cea6aac7d710d59fd29ce1b9a705449
tree0b96e557d181323d3c018301148753603da61913
parent5cb057a854a848be85dc2b81f6497964f5a93dbb
Improve (format "%g" bignum) precision

* src/editfns.c (styled_format): When formatting bignums with
floating-point conversions like %g, use long double if that
would lose less information than double, which is what the
code was already doing for fixnums.  On Fedora 28 x86-64, for
example, (format "%.100g" (1- (ash 1 64))) now yields
"18446744073709551615" instead of the numerically incorrect
"18446744073709549568".  Also, fix a stray INTEGERP that
can just be FIXNUMP, since bignums are not possible there.
src/editfns.c