Skip to content
  • bernalex's avatar
    Make Prelude.signum handle -0.0 correctly (#7858) · d9a20573
    bernalex authored
    
    
    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: default avatarAlexander Berntsen <alexander@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
    d9a20573
To find the state of this project's repository at the time of any of these versions, check out the tags.