We all know that 00 is indeterminate.
But, javascript says that:
Math.pow(0, 0) === 1 // true
In JavaScript Math.pow is defined as follows:
- If y is NaN, the result is NaN.
- If y is +0, the result is 1, even if x is NaN.
- If y is −0, the result is 1, even if x is NaN.
- If x is NaN and y is nonzero, the result is NaN.
- If abs(x)>1 and y is +∞, the result is +∞.
- If abs(x)>1 and y is −∞, the result is +0.
- If abs(x)==1 and y is +∞, the result is NaN.
- If abs(x)==1 and y is −∞, the result is NaN.
- If abs(x)<1 and y is +∞, the result is +0.
- If abs(x)<1 and y is −∞, the result is +∞.
- If x is +∞ and y>0, the result is +∞.
- If x is +∞ and y<0, the result is +0.
- If x is −∞ and y>0 and y is an odd integer, the result is −∞.
- If x is −∞ and y>0 and y is not an odd integer, the result is +∞.
- If x is −∞ and y<0 and y is an odd integer, the result is −0.
- If x is −∞ and y<0 and y is not an odd integer, the result is +0.
- If x is +0 and y>0, the result is +0.
- If x is +0 and y<0, the result is +∞.
- If x is −0 and y>0 and y is an odd integer, the result is −0.
- If x is −0 and y>0 and y is not an odd integer, the result is +0.
- If x is −0 and y<0 and y is an odd integer, the result is −∞.
- If x is −0 and y<0 and y is not an odd integer, the result is +∞.
- If x<0 and x is finite and y is finite and y is not an integer, the result is NaN.
emphasis mine
as a general rule, native functions to any language should work as described in the language specification. Sometimes this includes explicitly "undefined behavior" where it's up to the implementer to determine what the result should be, however this is not a case of undefined behavior.