kmath
kmath copied to clipboard
Taking the power of a complex zero results in NaN instead of 0
To reproduce:
ComplexField.power(Complex(0.0), Complex(2.0))
I created my own version of this function and ended up with the same problem, which was caused by me not testing for the special case of the base being zero. After I fixed it, I still failed on this:
ComplexField.power(Complex(-0.0), Complex(2.0))
I mention this here since in case you want to add a special test case for this.