[GHC] #9304: Floating point woes; Different behavior on Mac vs Linux

GHC ghc-devs at haskell.org
Sun Jul 13 18:40:25 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 carter):

 @lerkok, why is it "clearly incorrectly rounded"? I'm having trouble
 believing that claim.
 It could simply be that the way your input literals are encoded with more
 bits of precision in the x87 case.

 could you please try doing the original program as a self contained
 program like

 {{{
 module Main where


 main = do
    x <- return ((-4.4)::Double)
    y <- return ((2.4999999999999956):: Double)
    putStrLn $ show $ decodeFloat (x*y)

 }}}

 compile with
 {{{
 ghc main.hs -o -msse2 -fforce-recomp ; ./main ; ghc main.hs -o -fexcess-
 precision -fforce-recomp ; ./main
 }}}
 and tell us if theres a difference in the output in those two cases?

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9304#comment:10>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list