[GHC] #9120: Cache intermediate powers

GHC ghc-devs at haskell.org
Fri May 16 19:20:14 UTC 2014


#9120: Cache intermediate powers
-------------------------------------+------------------------------------
        Reporter:  basvandijk        |            Owner:
            Type:  bug               |           Status:  new
        Priority:  normal            |        Milestone:
       Component:  Compiler          |          Version:  7.8.2
      Resolution:                    |         Keywords:
Operating System:  Unknown/Multiple  |     Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown      |       Difficulty:  Unknown
       Test Case:                    |       Blocked By:
        Blocking:                    |  Related Tickets:
-------------------------------------+------------------------------------

Comment (by meteficha):

 I have no idea what is the purpose of this code, but why not the
 following?

 {{{#!haskell
 expt  2   e | e <= maxExpt2  = expts2  ! e
             | otherwise      = expts2  ! maxExpt2  * expt 2 (e-maxExpt2)
 expt 10   e | e <= maxExpt10 = expts10 ! e
             | otherwise      = expts10 ! maxExpt10 * expt 10 (e-maxExpt10)
 }}}

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


More information about the ghc-tickets mailing list