Raymond Toy pushed to branch issue-275b-signal-float-underflow at cmucl / cmucl
Commits:
-
45532060
by Raymond Toy at 2024-03-23T14:56:58-07:00
1 changed file:
Changes:
... | ... | @@ -212,3 +212,17 @@ |
212 | 212 | ;; most-positive-double-float. And a really big single-float.
|
213 | 213 | (assert-error 'reader-error (read-from-string "1.8d308"))
|
214 | 214 | (assert-error 'reader-error (read-from-string "1d999999999")))
|
215 | + |
|
216 | +(define-test reader.float-underflow
|
|
217 | + (:tag :issues)
|
|
218 | + (lisp::with-float-traps-enabled (:underflow)
|
|
219 | + ;; A denormal
|
|
220 | + (assert-error 'floating-point-underflow
|
|
221 | + (read-from-string "1e-40"))
|
|
222 | + (assert-error 'floating-point-underflow
|
|
223 | + (read-from-string (format nil "~A" least-positive-single-float)))
|
|
224 | + ;; The same for double-floats
|
|
225 | + (assert-error 'floating-point-underflow
|
|
226 | + (read-from-string "1d-308"))
|
|
227 | + (assert-error 'floating-point-underflow
|
|
228 | + (read-from-string (format nil "~A" least-positive-double-float))))) |