|
-- | Uses `Math.fround()` to convert to a `Float32`. |
|
-- | Returns *0.0* when outside the range. |
|
fromNumber' :: Number -> Float32 |
|
fromNumber' x = case fromNumber x of |
|
Nothing -> Float32 0.0 |
|
Just y -> y |
Is NaN a member of the Float32 type?
Maybe this should overflow to NaN rather than 0.0?
purescript-float32/src/Data/Float32.purs
Lines 53 to 58 in 3b70984
Is
NaNa member of theFloat32type?Maybe this should overflow to
NaNrather than0.0?