### Powers

*b*is familiar when

^{n}*n*is a whole integer (positive or negative). Here's an algorithm to compute it.

let rec pow (i, u) = if i < 0 then 1.0 / (pow (-i, u)) else if i = 0 then 1.0 else u * pow ((i-1), u)

*c/d = n*that is, for

*n*a rational number (then the solution is found by taking the

*dth*root of

*b*). Less so though I think when

^{c}*x = n*is some arbitrary real. That is, generally speaking how is

*b*computed?

^{x}

Logarithms and exponentiation. Since

*b = e*then^{log b}*b*.^{x}= (e^{log b})^{x}= e^{x (log b)}let powf (b, x) = exp (x * log b)This only works when

*b*is real and positive. The case negative*b*leads into the theory of complex powers.“Sometimes,' said Pooh, 'the smallest things take up the most room in your heart.”