power(a,b) based on Exponentiation by squaring