You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem seems to be the use ofrealToFrac (0.0 / 0.0). Note that 0.0/0.0 is NaN.
With -O, realToFrac NaN returns NaN
With -O0, realToFrac NaN returns -Infinity
You would expect realToFrac :: Double -> Double to always be id, but apparently that is not the case in GHC right now. It is so only if compile with optimisations.
The text was updated successfully, but these errors were encountered:
Of course it's somewhat unreasonable to blame double-conversion for this. The fact that Haskell does not provide a function to reasonably convert Double -> CDouble is insane (I posted here).
If I compile with
-O0
, I get the following test failure:The test code in question is https://github.com/bos/double-conversion/blob/e4b7956d51fbb79ada95412519bd2a6a680def23/tests/Properties.hs#L9-L13
where
a = 0.0
,b = 0.0
.The problem seems to be the use of
realToFrac (0.0 / 0.0)
. Note that0.0/0.0
isNaN
.-O
,realToFrac NaN
returnsNaN
-O0
,realToFrac NaN
returns-Infinity
You would expect
realToFrac :: Double -> Double
to always beid
, but apparently that is not the case in GHC right now. It is so only if compile with optimisations.The text was updated successfully, but these errors were encountered: