[GHC] #7858: Fix definitions of abs/signum for Floats/Doubles

GHC ghc-devs at haskell.org
Tue Aug 19 04:33:53 UTC 2014


#7858: Fix definitions of abs/signum for Floats/Doubles
-------------------------------------+-------------------------------------
              Reporter:  lerkok      |            Owner:  bernalex
                  Type:  bug         |           Status:  patch
              Priority:  normal      |        Milestone:  7.10.1
             Component:              |          Version:  7.6.3
  libraries/base                     |         Keywords:  floating point
            Resolution:              |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple                   |       Blocked By:
       Type of failure:              |  Related Tickets:  #9238
  None/Unknown                       |
             Test Case:              |
              Blocking:              |
Differential Revisions:  Phab:D145   |
-------------------------------------+-------------------------------------

Comment (by Austin Seipp <austin@…>):

 In [changeset:"6f6ee6eaa348b1a4815190c4d526d5c81c264fa7/ghc"]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="6f6ee6eaa348b1a4815190c4d526d5c81c264fa7"
 Make Prelude.abs handle -0.0 correctly (#7858)

 Summary:
 Make the `Float` and `Double` implementations of `abs` handle -0.0
 correctly per IEEE-754.

 abs (-0.0::Float) and abs (-0.0::Double) previously returned -0.0, when
 they should return 0.0. This patch fixes this.

 Signed-off-by: Alexander Berntsen <alexander at plaimi.net>

 Test Plan: abs (-0.0::Double) should = 0.0 instead of (-0.0)

 Reviewers: ekmett, hvr, austin, rwbarton

 Reviewed By: austin, rwbarton

 Subscribers: phaskell, trofi, simonmar, relrod, ezyang, carter

 Differential Revision: https://phabricator.haskell.org/D145

 GHC Trac Issues: #7858
 }}}

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


More information about the ghc-tickets mailing list