2 ms·
Math libraries (and language standards) should follow the guidance in IEEE-754 unless they have a very good reason not to do so. "pow(x, +/-0) is 1 for any x (
by stephencanon 13y ago
Math libraries (and language standards) should follow the guidance in IEEE-754 unless they have a very good reason not to do so.
"pow(x, +/-0) is 1 for any x (even a zero, quiet NaN, or infinity)."
"pown(x, 0) is 1 for any x (even a zero, quiet NaN, or infinity)."
- but -
"powr(+/-0, +/-0) signals the invalid operation [and returns NaN]."
"pown" refers to the function on R x N defined by repeated multiplication; "powr" is the function on R x R defined by exp(y log(x)). "pow" refers to the mental hodgepodge of the two that most people intend when they write x^y without really thinking about it.