Raymond Toy pushed to branch issue-275b-signal-float-underflow at cmucl / cmucl
Commits:
-
bb8eb44c
by Raymond Toy at 2024-03-26T08:25:46-07:00
1 changed file:
Changes:
... | ... | @@ -1869,16 +1869,15 @@ the end of the stream." |
1869 | 1869 | |
1870 | 1870 | ;; Otherwise the number might fit, so we carefully compute the result.
|
1871 | 1871 | (handler-case
|
1872 | - (with-float-traps-masked (:underflow)
|
|
1873 | - (let* ((ratio (/ (* (expt 10 exponent) number)
|
|
1874 | - divisor))
|
|
1875 | - (result (coerce ratio float-format)))
|
|
1876 | - (when (and (zerop result) (not (zerop number)))
|
|
1877 | - ;; The number we've read is so small that it gets
|
|
1878 | - ;; converted to 0.0, but is not actually zero. Signal an
|
|
1879 | - ;; error. See CLHS 2.3.1.1.
|
|
1880 | - (error _"Underflow"))
|
|
1881 | - result))
|
|
1872 | + (let* ((ratio (/ (* (expt 10 exponent) number)
|
|
1873 | + divisor))
|
|
1874 | + (result (coerce ratio float-format)))
|
|
1875 | + (when (and (zerop result) (not (zerop number)))
|
|
1876 | + ;; The number we've read is so small that it gets
|
|
1877 | + ;; converted to 0.0, but is not actually zero. Signal an
|
|
1878 | + ;; error. See CLHS 2.3.1.1.
|
|
1879 | + (error _"Underflow"))
|
|
1880 | + result)
|
|
1882 | 1881 | (floating-point-underflow ()
|
1883 | 1882 | ;; Resignal the underflow, but allow the user to continue with
|
1884 | 1883 | ;; 0.
|