Finding the value of an exponent