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

GHC ghc-devs at haskell.org
Sun Nov 16 14:34:47 UTC 2014


#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:              |     Architecture:  Unknown/Multiple
  Unknown/Multiple                   |       Difficulty:  Unknown
       Type of failure:  Incorrect   |       Blocked By:
  result at runtime                  |  Related Tickets:
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
Changes (by thomie):

 * status:  new => infoneeded
 * failure:  None/Unknown => Incorrect result at runtime


Comment:

 I cannot reproduce your findings. Can you try again, specifying your GHC
 version, OS and architecture. Thanks.

 {{{
 $ uname -op
 x86_64 GNU/Linux

 $ ghc-7.6.3 --interactive
 GHCi, version 7.6.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> abs(-0)
 0

 Prelude> signum(-0) == 0
 True

 Prelude> let x = -0 in abs x * signum x == x
 True
 }}}

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


More information about the ghc-tickets mailing list