Consider underflow in float conversion functions.
Closes PR14462. original commit: a39b89bb7dae491f779fbcfa51ea0105c3b46c9a
This commit is contained in:
parent
42ee5977b6
commit
d0f6cac951
|
@ -1759,15 +1759,13 @@
|
|||
(-NegFlonum . -> . -NegInt)
|
||||
(-NonPosFlonum . -> . -NonPosInt)
|
||||
(-Flonum . -> . -Int))]
|
||||
[real->single-flonum (cl->* (-PosReal . -> . -PosSingleFlonum)
|
||||
(-NegReal . -> . -NegSingleFlonum)
|
||||
(-RealZero . -> . -SingleFlonumZero)
|
||||
[real->single-flonum (cl->* (-RealZero . -> . -SingleFlonumZero)
|
||||
;; no positive / negative cases, possible underflow
|
||||
(-NonNegReal . -> . -NonNegSingleFlonum)
|
||||
(-NonPosReal . -> . -NonPosSingleFlonum)
|
||||
(-Real . -> . -SingleFlonumZero))]
|
||||
[real->double-flonum (cl->* (-PosReal . -> . -PosFlonum)
|
||||
(-NegReal . -> . -NegFlonum)
|
||||
(-RealZero . -> . -FlonumZero)
|
||||
[real->double-flonum (cl->* (-RealZero . -> . -FlonumZero)
|
||||
;; no positive / negative cases, possible underflow
|
||||
(-NonNegReal . -> . -NonNegFlonum)
|
||||
(-NonPosReal . -> . -NonPosFlonum)
|
||||
(-Real . -> . -Flonum))]
|
||||
|
@ -2324,9 +2322,8 @@
|
|||
(-NegExtFlonum . -> . -NegInt)
|
||||
(-NonPosExtFlonum . -> . -NonPosInt)
|
||||
(-ExtFlonum . -> . -Int))]
|
||||
[real->extfl (cl->* (-PosReal . -> . -PosExtFlonum)
|
||||
(-NegReal . -> . -NegExtFlonum)
|
||||
(-RealZero . -> . -ExtFlonumZero)
|
||||
[real->extfl (cl->* (-RealZero . -> . -ExtFlonumZero)
|
||||
;; no positive / negative cases, possible underflow
|
||||
(-NonNegReal . -> . -NonNegExtFlonum)
|
||||
(-NonPosReal . -> . -NonPosExtFlonum)
|
||||
(-Real . -> . -ExtFlonum))]
|
||||
|
@ -2337,9 +2334,8 @@
|
|||
(-NonPosExtFlonum . -> . -NonPosRat)
|
||||
(-ExtFlonum . -> . -Rat))]
|
||||
[extfl->inexact (cl->* (-ExtFlonumZero . -> . -FlonumZero)
|
||||
(-PosExtFlonum . -> . -PosFlonum)
|
||||
;; no positive / negative cases, possible underflow
|
||||
(-NonNegExtFlonum . -> . -NonNegFlonum)
|
||||
(-NegExtFlonum . -> . -NegFlonum)
|
||||
(-NonPosExtFlonum . -> . -NonPosFlonum)
|
||||
(-ExtFlonum . -> . -Flonum))]
|
||||
[unsafe-extflabs (extflabs-type)]
|
||||
|
|
|
@ -413,6 +413,16 @@
|
|||
(tc-e (min (ann -2 Negative-Fixnum) (ann 3 Fixnum)) -NegFixnum)
|
||||
(tc-e (min (ann 3 Fixnum) (ann -2 Negative-Fixnum)) -NegFixnum)
|
||||
(tc-e (exact->inexact (ann 3 Number)) (t:Un -InexactReal -InexactComplex))
|
||||
(tc-e (real->double-flonum #e1e-500) -NonNegFlonum)
|
||||
(tc-e (real->double-flonum #e-1e-500) -NonPosFlonum)
|
||||
(tc-e (real->single-flonum #e1e-500) -NonNegSingleFlonum)
|
||||
(tc-e (real->single-flonum #e-1e-500) -NonPosSingleFlonum)
|
||||
(tc-e (real->single-flonum 1e-300) -NonNegSingleFlonum)
|
||||
(tc-e (real->single-flonum -1e-300) -NonPosSingleFlonum)
|
||||
(tc-e (extfl->inexact 1t-500) -NonNegFlonum)
|
||||
(tc-e (extfl->inexact -1t-500) -NonPosFlonum)
|
||||
(tc-e (real->extfl #e1e-8192) -NonNegExtFlonum)
|
||||
(tc-e (real->extfl #e-1e-8192) -NonPosExtFlonum)
|
||||
(tc-err (let: ([z : 10000000000000 10000000000000]) z)) ; unsafe
|
||||
(tc-err (let: ([z : -4611686018427387904 -4611686018427387904]) z)) ; unsafe
|
||||
(tc-e (let: ([z : -4611686018427387905 -4611686018427387905]) z) (-val -4611686018427387905))
|
||||
|
|
Loading…
Reference in New Issue
Block a user