Clean up make-float-aux due to #277
In make-float-aux
, we have this bit of code:
(when (and (zerop result) (not (zerop number)))
;; The number we've read is so small that it gets
;; converted to 0.0, but is not actually zero. In this
;; case, we want to round such small numbers to
;; least-positive-foo-float. If it's still too small, we
;; want to signal an error saying that we can't really
;; convert it because the exponent is too small.
;; See CLHS 2.3.1.1.
(let ((float-limit (ecase float-format
((short-float single-float)
least-positive-single-float)
(double-float
least-positive-double-float)
#+double-double
(double-double-float
ext:least-positive-double-double-float))))
(if (>= (* 2 ratio) float-limit)
(setf result float-limit)
(error _"Underflow"))))
However, since #277 (closed) was fixed, we return a correctly rounded value for result
. Hence the code testing ratio
against float-limit
isn't needed. If result
is 0 and number
is not zero, then the number definitely can't be represented as a float. We can remove all of that float-limit
stuff and just throw an error.