numerical error introduced by -O1
f x = x * 1000000.1
g y True = y
g y False = g y True
z = let x = 100000000000.0 in
f x - g (f x) True
main = putStrLn (show z)
This program prints "-2.328125" when compiled with "-O1".
Running main
from within ghci gives "0.0", as it should.
Occurs under Mac OS and Linux (both x86).
Trac metadata
Trac field | Value |
---|---|
Version | 6.10.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |