could be more simple than you think
http://en.wikipedia.org/wiki/Exponentiation