big-math icon indicating copy to clipboard operation
big-math copied to clipboard

BigComplexMath#sqrt fails when x is a negative real number

Open Onedy opened this issue 10 months ago • 0 comments

https://github.com/eobermuhlner/big-math/blob/b659e2f6f3f79a64d6d587c0876dac5e06870012/ch.obermuhlner.math.big/src/main/java/ch/obermuhlner/math/big/BigComplexMath.java#L282 This fails when x is a negative real number because you are dividing (x+abs(x))/abs(x+abs(x)) which is 0/0.

Maybe these are helpful: https://mathworld.wolfram.com/SquareRoot.html and org.apache.commons.numbers.complex.Complex#sqrt() from org.apache.commons:commons-numbers-complex.

Onedy avatar Apr 22 '24 21:04 Onedy