
The float literal 1e-100000000000000000000000000000000000000000000 in GHC evaluates to 1.0, and 1e-999999999999999999999999999999999999999999999 evaluates to 10.0. Is it a bug, or a documented overflow behavior? What it the correct place to submit bug reports concerning GHC? -- Thank you, Vladimir Reshetnikov (aka nikov), Microsoft MVP

On Sat, Apr 5, 2008 at 1:00 AM, Vladimir Reshetnikov
The float literal 1e-100000000000000000000000000000000000000000000 in GHC evaluates to 1.0, and 1e-999999999999999999999999999999999999999999999 evaluates to 10.0. Is it a bug, or a documented overflow behavior?
Sounds like a bug to me. I wasn't able to test your example in GHCi because it started consuming all my memory. In GHCi 6.8.2 I got: Prelude> let x = 1e-1000000 *** Exception: stack overflow I tried compiling the following program with "ghc -O --make", and it again started consuming all memory: x = 1e-100000000 :: Double main = print x
What it the correct place to submit bug reports concerning GHC?
http://hackage.haskell.org/trac/ghc/wiki/ReportABug -- I'm doing Science and I'm still alive.

I don't know if it is a bug, but 100000000000000000000000000000000000000000000 = 0 (mod 2^32), so, if GHC considers exponent as Int (not Integer), then it's the same as 1e0 = 1. In the same way, 999999999999999999999999999999999999999999999 = -1 (mod 2^32), and 1e-(-1) = 1e1 = 10. Note also that the function "exponent" from the RealFloat class has the type exponent :: a -> Int On 5 Apr 2008, at 12:00, Vladimir Reshetnikov wrote:
The float literal 1e-100000000000000000000000000000000000000000000 in GHC evaluates to 1.0, and 1e-999999999999999999999999999999999999999999999 evaluates to 10.0. Is it a bug, or a documented overflow behavior?
What it the correct place to submit bug reports concerning GHC? -- Thank you,
Vladimir Reshetnikov (aka nikov), Microsoft MVP _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (3)
-
David Benbennick
-
Miguel Mitrofanov
-
Vladimir Reshetnikov