Chapter 3: Q10E (page 202)
Devise an algorithm to compute xn, where xis a real number and nis an integer. [Hint:First give a procedure for computing xnwhen nis nonnegative by successive multiplication by x, starting with 1. Then extend this procedure, and use the fact that x−n=1/xnto compute xnwhen nis negative.]
Short Answer
The required algorithm is designed.