mirror of
https://github.com/apache/commons-math.git
synced 2025-03-06 00:19:18 +00:00
Fixed Complex.reciprocal() for zero argument.
JIRA: MATH-934 git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1459927 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8c2199df0f
commit
724795b551
@ -55,6 +55,9 @@ This is a minor release: It combines bug fixes and new features.
|
||||
Changes to existing features were made in a backwards-compatible
|
||||
way such as to allow drop-in replacement of the v3.1[.1] JAR file.
|
||||
">
|
||||
<action dev="luc" type="fix" issue="MATH-934">
|
||||
Fixed Complex.reciprocal() for zero argument.
|
||||
</action>
|
||||
<action dev="luc" type="update" issue="MATH-951" due-to="Charles Cooper">
|
||||
Improved speed of FastMath copysign methods.
|
||||
</action>
|
||||
|
@ -302,7 +302,7 @@ public class Complex implements FieldElement<Complex>, Serializable {
|
||||
}
|
||||
|
||||
if (real == 0.0 && imaginary == 0.0) {
|
||||
return NaN;
|
||||
return INF;
|
||||
}
|
||||
|
||||
if (isInfinite) {
|
||||
|
@ -331,7 +331,7 @@ public class ComplexTest {
|
||||
|
||||
@Test
|
||||
public void testReciprocalZero() {
|
||||
Assert.assertEquals(Complex.ZERO.reciprocal(), Complex.NaN);
|
||||
Assert.assertEquals(Complex.ZERO.reciprocal(), Complex.INF);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Loading…
x
Reference in New Issue
Block a user