mirror of
https://github.com/apache/commons-math.git
synced 2025-02-08 02:59:36 +00:00
MATH-657
Reverting to previous behaviour, as requested by P. Steitz. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1164917 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
32b0f7336b
commit
97b440fc8e
@ -256,7 +256,8 @@ public class Complex implements FieldElement<Complex>, Serializable {
|
||||
}
|
||||
|
||||
if (divisor.isZero) {
|
||||
return isZero ? NaN : INF;
|
||||
// return isZero ? NaN : INF; // See MATH-657
|
||||
return NaN;
|
||||
}
|
||||
|
||||
if (divisor.isInfinite() && !isInfinite()) {
|
||||
@ -292,7 +293,8 @@ public class Complex implements FieldElement<Complex>, Serializable {
|
||||
return NaN;
|
||||
}
|
||||
if (divisor == 0d) {
|
||||
return isZero ? NaN : INF;
|
||||
// return isZero ? NaN : INF; // See MATH-657
|
||||
return NaN;
|
||||
}
|
||||
if (Double.isInfinite(divisor)) {
|
||||
return !isInfinite() ? ZERO : NaN;
|
||||
|
@ -229,7 +229,8 @@ public class ComplexTest {
|
||||
public void testDivideZero() {
|
||||
Complex x = new Complex(3.0, 4.0);
|
||||
Complex z = x.divide(Complex.ZERO);
|
||||
Assert.assertEquals(z, Complex.INF);
|
||||
// Assert.assertEquals(z, Complex.INF); // See MATH-657
|
||||
Assert.assertEquals(z, Complex.NaN);
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -573,10 +574,7 @@ public class ComplexTest {
|
||||
|
||||
@Test
|
||||
public void testAtanI() {
|
||||
for (int i = -10; i < 10; i++) {
|
||||
System.out.println(new Complex(0, 1 - 0.1 * i).atan());
|
||||
}
|
||||
Assert.assertTrue(Complex.I.atan().isInfinite());
|
||||
Assert.assertTrue(Complex.I.atan().isNaN());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
x
Reference in New Issue
Block a user