#4413: (^^) is not correct for Double and Float
----------------------------------------------+-----------------------------
Reporter: daniel.is.fischer | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: libraries/base | Version: 7.1
Keywords: Double, Float, exponentiation | Testcase:
Blockedby: | Difficulty:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: Incorrect result
at runtime
----------------------------------------------+-----------------------------
Comment(by daniel.is.fischer):
It produces correct (in the sense of "if the real result of `x`^`n`^ is a
finite nonzero number, so is `x ^^ n`, and the value of `x ^^ n` differs
only very little from each of the real value, `x ** n` and `fromRational
(toRational x ^^ n)`") results for more inputs. When `abs(x) > 1, n < 0`
and `x ^ (-n)` gives Infinity, `so x ^^ n` yields `1/Infinity = 0, (1/x) ^
(-n)` can, as in the example, yield a nonzero (subnormal) number.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4413#comment:2>
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