3 ms·
It's O(log n) because Haskell is smart enough to implement exponentiation by repeated squaring and summing as appropriate? (There must be a better name for tha
by colomon 13y ago
It's O(log n) because Haskell is smart enough to implement exponentiation by repeated squaring and summing as appropriate? (There must be a better name for that.)
- crntaylor 13y agoYes -- see the source here: http://hackage.haskell.org/package/base-4.6.0.1/docs/src/GHC-Real.html#%5E http://hackage.haskell.org/package/base-4.6.0.1/docs/src/GHC...
- NoodleIncident 13y agoI believe that's called Russian Peasant Exponentiation.