Calculate the N-th power of a big number using exponentiation by squaring.