[GHC] #8539: Data.Complex shouldn't use default implementation of (**)

GHC ghc-devs at haskell.org
Mon Apr 28 11:29:32 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):

 We can also add special case for raising to 1 to increase accuracy:
 {{{
 Prelude Data.Complex> exp $ log (1:+2) * (1:+0) :: Complex Double
 0.9999999999999998 :+ 2.0000000000000004
 }}}
 By adding this line:
 {{{
 x ** (1:+0) = x
 }}}
 But I'm not sure. Is it necessary? This function already has 3
 definitions.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8539#comment:9>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list