Power
Chapter I  integer exponent
PROBLEM
A frequently occuring operation in numbertheoretic computations is raising a number to a power another number, also known as exponentiation. We would like an efficient way to compute X**Z (X to the Z power), where X is a real number and Z is a nonnegative integer. Usually we use the ** operator for calculation of the power function,
raising a real number to a integer exponent. Another way to this calculation is
the following algorithm POWER stated by alKashi about 1414 C.E.
IMPLEMENTATION
Unit: internal function, external function without procedure statement
Parameters: real X, nonnegative integer Z Returns: X**Z
EXAMPLE
[Regina] The following program ends with Error 26 ... line 3: Invalid whole number
But program
displays e = 2.71828183
Chapter II  real exponent The following function REPOWER computes the result by raising the real number X to the given real exponent Z.
IMPLEMENTATION
Unit: internal function
Parameters: real numbers X and Z, a positive integer P  number of significant digits of result, default is 9 Interface: the functions EXP and LN Returns: X**Z or writes error message REAL_POWER: Result is undefined
CONNECTIONS Exponential function
Natural logarithms Select computation of S = 0.5 * N**(2/3) Technique: Bit array encoded as decimal number
Literature
Knuth D. E. Seminumerical Algorithms, vol. 2 of The Art of Computer Programming AddisonWesley, 1973
