knaveofdiamonds wrote:

> One note of advice - the operator to use is actually ** not ^ as might
> be expected:
> 
> irb> 7 ^ 2 # Gives 5
> irb> 7 ** 49 # Gives 49

I think you  meant 7 ** 2 = 49, whereas
7 ** 49 = 256923577521058878088611477224235621321607

But, since these are integers, we are better off computing n * n,
not n ** 2. There's really no point (in time efficiency) to explicitly
raising n to a power p unless n is not an integer or p is relatively large.

-- 
Paul Lutus
http://www.arachnoid.com