[GHC] #9304: Floating point woes; Different behavior on Mac vs Linux
GHC
ghc-devs at haskell.org
Sun Jul 13 22:27:41 UTC 2014
#9304: Floating point woes; Different behavior on Mac vs Linux
-------------------------------------+------------------------------------
Reporter: lerkok | Owner:
Type: bug | Status: new
Priority: high | Milestone:
Component: Compiler | Version: 7.8.3
Resolution: | Keywords: floating point
Operating System: Unknown/Multiple | Architecture: Unknown/Multiple
Type of failure: None/Unknown | Difficulty: Unknown
Test Case: | Blocked By: 9276
Blocking: | Related Tickets:
-------------------------------------+------------------------------------
Comment (by lerkok):
And here're the results for the original program:
{{{
[ubuntu-VirtualBox]~/precision/regular>cat main.hs
x, y, r :: Double
x = -4.4
y = 2.4999999999999956
r = x * y
main :: IO ()
main = print $ decodeFloat r
[ubuntu-VirtualBox]~/precision/regular>rm main.hi; rm main.o; ghc main.hs
-o main; ./main
[1 of 1] Compiling Main ( main.hs, main.o )
Linking main ...
(-6192449487634422,-49)
[ubuntu-VirtualBox]~/precision/regular>rm main.hi; rm main.o; ghc main.hs
-msse2 -o main; ./main
[1 of 1] Compiling Main ( main.hs, main.o )
Linking main ...
(-6192449487634422,-49)
[ubuntu-VirtualBox]~/precision/regular>rm main.hi; rm main.o; ghc main.hs
-fexcess-precision -o main; ./main
[1 of 1] Compiling Main ( main.hs, main.o )
Linking main ...
(-6192449487634422,-49)
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9304#comment:22>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list