[GHC] #9810: encodeFloat 1 2047 = -1024.0
GHC
ghc-devs at haskell.org
Wed Nov 19 11:13:45 UTC 2014
#9810: encodeFloat 1 2047 = -1024.0
-------------------------------------+-------------------------------------
Reporter: luite | Owner: hvr
Type: bug | Status: patch
Priority: normal | Milestone: 7.10.1
Component: Compiler | Version: 7.9
Resolution: | Keywords: ieee
Operating System: | Architecture: Unknown/Multiple
Unknown/Multiple | Difficulty: Unknown
Type of failure: | Blocked By:
None/Unknown | Related Tickets: #9811
Test Case: |
Blocking: |
Differential Revisions: Phab:D486 |
-------------------------------------+-------------------------------------
Comment (by Herbert Valerio Riedel <hvr@…>):
In [changeset:"e2af452cd533778c5447719c59429d72bb1fe00d/ghc"]:
{{{
#!CommitTicketReference repository="ghc"
revision="e2af452cd533778c5447719c59429d72bb1fe00d"
Restore exact old semantics of `decodeFloat`
`integer-gmp2` uses the new 64bit-based IEEE deconstructing primop
introduced in b62bd5ecf3be421778e4835010b6b334e95c5a56.
However, the returned values differ for exceptional IEEE values:
Previous (expected) semantics:
> decodeFloat (-1/0)
(-4503599627370496,972)
> decodeFloat (1/0)
(4503599627370496,972)
> decodeFloat (0/0)
(-6755399441055744,972)
Currently (broken) semantics:
> decodeFloat (-1/0 :: Double)
(-9223372036854775808,-53)
> decodeFloat (1/0 :: Double)
(-9223372036854775808,-53)
> decodeFloat (0/0 :: Double)
(-9223372036854775808,-53)
This patch reverts to the old expected semantics.
I plan to revisit the implementation during GHC 7.11 development.
This should address #9810
Reviewed By: austin, ekmett, luite
Differential Revision: https://phabricator.haskell.org/D486
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9810#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list