[GHC] #8539: Data.Complex shouldn't use default implementation of (**)
GHC
ghc-devs at haskell.org
Wed Apr 30 07:12:34 UTC 2014
#8539: Data.Complex shouldn't use default implementation of (**)
-------------------------------------+-------------------------------------
Reporter: jjaredsimpson | Owner:
Type: bug | Status: patch
Priority: low | Milestone:
Component: Prelude | Version: 7.6.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture: Unknown/Multiple
Type of failure: Incorrect result | Difficulty: Easy (less than 1
at runtime | hour)
Test Case: | Blocked By:
Blocking: | Related Tickets:
-------------------------------------+-------------------------------------
Comment (by yalas):
Replying to [comment:18 Scott Turner]:
> Maybe we are talking about it because it has the rule
> {{{
> x ** 0 == 1
> }}}
I think it is completely safe to define:
{{{
_ ** (0:+0) = 1 :+ 0
}}}
Because {{{exp $ log any_finite_number * (0:+0)}}} always equals
{{{1:+0}}}.
The only difference is for NaN, but {{{NaN**0 :: Double}}} equals {{{1}}}
too.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8539#comment:20>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list