Closed
Description
This function raises real numbers to integral powers.
According to IEEE Std 754-2008 for Floating-Point Arithmetic, page 44:
- pown(x, 0) is 1 for any x (even a zero, quiet NaN, or infinity)
- pown(±0, n) is ±∞ and signals the divideByZero exception for odd integral n<0
- pown(±0, n) is +∞ and signals the divideByZero exception for even integral n<0
- pown(±0, n) is +0 for even integral n>0
- pown(±0, n) is ±0 for odd integral n>0.
In addition to actual pown function more restricted versions would be useful:
- version that raises integers to non-negative powers (will have integral output)
- version that raises integers to integer powers (will have real output due to -ve powers being permitted)