-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Labels
Description
When BigComplexMath.sqrt is invoked with an argument that has a negative or zero real part and a zero imaginary part, it throws an ArithmeticException:
BigComplexMath.sqrt(BigComplex.ONE.negate(), MathContext.DECIMAL64)Exception in thread "main" java.lang.ArithmeticException: Division undefined
at java.base/java.math.BigDecimal.divide(BigDecimal.java:1831)
at ch.obermuhlner.math.big.BigComplex.divide(BigComplex.java:287)
at ch.obermuhlner.math.big.BigComplexMath.sqrt(BigComplexMath.java:289)
Expected behaviour:
BigComplexMath.sqrt should not throw an ArithmeticException but compute the result (in the above case 0 + 1i) instead.
Reactions are currently unavailable