[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:"d9a20573f473cc7389004470999b8a318aa6b3f2/ghc"]:
{{{
#!CommitTicketReference repository="ghc"
revision="d9a20573f473cc7389004470999b8a318aa6b3f2"
Make Prelude.signum handle -0.0 correctly (#7858)
Summary:
Make the `Float` and `Double` implementations of `signum` handle -0.0
correctly per IEEE-754.
This, together with "Make Prelude.abs handle -0.0 correctly (#7858)",
fixes Trac #7858.
Depends on D145
Signed-off-by: Alexander Berntsen <alexander at plaimi.net>
Test Plan:
signum of (-0.0) should be (-0.0) not 0.0.
Test program:
main =
putStrLn $ p ++ " " ++ n
where
f = show . signum
p = f (-0.0 :: Double)
n = f (0.0 :: Double)
Reviewers: ekmett, hvr, rwbarton, austin
Reviewed By: austin
Subscribers: phaskell, simonmar, relrod, ezyang, carter
Differential Revision: https://phabricator.haskell.org/D148
GHC Trac Issues: #7858
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/7858#comment:14>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list