#5178: RULES "minusFloat x x" and "timesFloat 0.0 x" break IEEE-754
compatibility
---------------------------------+------------------------------------------
Reporter: liyang | Owner:
Type: bug | Status: new
Priority: normal | Component: libraries/base
Version: 7.0.3 | Keywords:
Testcase: | Blockedby:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: Incorrect result at runtime
---------------------------------+------------------------------------------
In GHC/Base.lhs, a comment around line ~778 notes that the following rules
for Doubles give the wrong answer for NaN:
{{{
"minusDouble x x" forall x#. (-##) x# x# = 0.0##
"timesDouble 0.0 x" forall x#. (*##) 0.0## x# = 0.0##
"timesDouble x 0.0" forall x#. (*##) x# 0.0## = 0.0##
}}}
However, immediately above are corresponding rules for Floats:
{{{
"minusFloat x x" forall x#. minusFloat# x# x# = 0.0#
"timesFloat x 0.0" forall x#. timesFloat# x# 0.0# = 0.0#
"timesFloat0.0 x" forall x#. timesFloat# 0.0# x# = 0.0#
}}}
These should probably be removed.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5178>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs