All pastes #931123 Raw Edit

Unnamed

public text v1 · immutable
·published 2008-03-06 23:37 UTC
rendered paste body
1. Part 1 - Exponentiation

Implement a recursive function exponentiate x y for calculating x^y for y => 0,

using the identities
x^y = (x^(y/2))^2     if y is even
x*(x^(y−1))           if y is odd
Do not use built in Haskell functions or operators for exponentiation (e.g. ^).