[GHC] #8780: abs for IEEE floating point is slightly wrong.

GHC ghc-devs at haskell.org
Mon Mar 2 12:33:32 UTC 2015


#8780: abs for IEEE floating point is slightly wrong.
-------------------------------------+-------------------------------------
        Reporter:  augustss          |                   Owner:
            Type:  bug               |                  Status:  infoneeded
        Priority:  low               |               Milestone:
       Component:  Compiler          |                 Version:  7.6.3
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  Incorrect result  |  Unknown/Multiple
  at runtime                         |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by augustss):

 It seems the printing of -0 has changed.  Here's my session

 {{{
 $ ghci
 GHCi, version 7.8.3: http://www.haskell.org/ghc/  :? for help
 Loading package ghc-prim ... linking ... done.
 Loading package integer-gmp ... linking ... done.
 Loading package base ... linking ... done.
 Prelude> let x = -0
 Prelude> x
 0
 Prelude> isNegativeZero x
 True
 Prelude> isNegativeZero (abs x)
 True
 Prelude> isNegativeZero (signum x)
 False
 }}}

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


More information about the ghc-tickets mailing list