Following inputs return NaN - aNi in Notepad. Seems like all negative bases yield the same:
(-0.5)^Infinity
(-1)^Infinity
(-2)^Infinty
probably the underlying function pow() returns a Complex with both Real and Imaginary part set to NaN. (haven't checked).
Definitely, NaN + aNi is wrong. But whether this is simply an issue with the rendering, or the underlying logic, is to be analyzed. Some thoughts:
-
Whether the result should be a Complex with both Real and Imaginary parts set to NaN, is questionable (after all there is a NaN already, no need to introduce a "second, complex NaN" value maybe).
-
for -1 < a < 0, the result should probably be zero, as in javascript, this one converges: Math.pow(-0.5,Infinity) // 0
-
for a < -1 the result should not be Infinity (so, unlike javascript), because this is clearly divergent. (I don't understand javascript behavior: Math.pow(-2,Infinity) // Infinity
-
-Infinity as exponent should also be considered (currently these cases also return incorrect NaN + aNi, but convergence / divergence should also be considered separately for -Infinity)
Following inputs return
NaN - aNiin Notepad. Seems like all negative bases yield the same:(-0.5)^Infinity(-1)^Infinity(-2)^Infintyprobably the underlying function
pow()returns aComplexwith both Real and Imaginary part set toNaN. (haven't checked).Definitely,
NaN + aNiis wrong. But whether this is simply an issue with the rendering, or the underlying logic, is to be analyzed. Some thoughts:Whether the result should be a
Complexwith both Real and Imaginary parts set toNaN, is questionable (after all there is aNaNalready, no need to introduce a "second, complexNaN" value maybe).for
-1 < a < 0, the result should probably be zero, as in javascript, this one converges:Math.pow(-0.5,Infinity) // 0for
a < -1the result should not be Infinity (so, unlike javascript), because this is clearly divergent. (I don't understand javascript behavior:Math.pow(-2,Infinity) // Infinity-Infinityas exponent should also be considered (currently these cases also return incorrectNaN + aNi, but convergence / divergence should also be considered separately for-Infinity)