Returns $num raised to the power of $exp