Ruby actually offers a power function, if you want to be lazy :) 

base\*\*exp