fix rounding of floats big enough to be bignums
commit8754394dc238f6932935bf46490b2206c2a33344
authorChristophe Rhodes <csr21@cantab.net>
Sun, 4 Sep 2011 19:27:17 +0000 (4 20:27 +0100)
committerChristophe Rhodes <csr21@cantab.net>
Sun, 4 Sep 2011 19:32:03 +0000 (4 20:32 +0100)
tree328eb2a069fe9256e599c9f32c855aa969e7144a
parent4783db4884a231e8d217ce85feaa2c32a53ef6b9
fix rounding of floats big enough to be bignums

Wow, so broken: the attempt to confuse while pretending to do
round-to-even goes back decades to original CMUCL sources.  Rewrite
the bignum branch with a more careful and clear version that is obviously
correct.

Optimizers might want to elide some of the computation on appropriate
platforms: on 32-bit platforms, all single floats outside the fixnum
range are integral, while on 64-bit platforms all single and double floats
outside the fixnum range are integral.  (This could be implemented by
comparing most-fooative-fixnum with fooble-float-significand-byte)
src/code/float.lisp
tests/float.pure.lisp