Whis idoes 0 to the power of 0 =1 ?
807603Nov 19 2007 — edited Nov 19 2007double x = Math.pow(0,0);
x now equals positive 1, however this is mathematically incorrect. Really, zero to the power of zero is undefined. Originally I thought that the pow(0,0) returns 1 so that a double data type (ie not a string) is returned. Than I realized that in certain situations the pow method will return NaN, so my previous thoughts as to why 1 is returned cannot be true.
Can anyone tell me why pow(0,0) equals 1 and not undefined, or at least NaN? It's like this in all other programing languages I know. Is there some sort of mathematical reasoning of which I am unaware of; were zero the power of zero equals one?
Thanks guys