kmath icon indicating copy to clipboard operation
kmath copied to clipboard

Taking the power of a complex zero results in NaN instead of 0

Open lokedhs opened this issue 1 year ago • 1 comments

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.

lokedhs avatar Feb 08 '24 14:02 lokedhs