You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by er...@apache.org on 2017/08/31 08:03:04 UTC
commons-numbers git commit: NUMBERS-22 : removed automatic
assignments of Inf and NaN from Complex.reciprocal();
removed tests ComplexTest.testReciprocalInf() and
ComplexTest.testReciprocalZero() that will no longer evaluate correctly
Repository: commons-numbers
Updated Branches:
refs/heads/complex-dev 2d273aada -> ec3bb9ed9
NUMBERS-22 : removed automatic assignments of Inf and NaN from Complex.reciprocal(); removed tests ComplexTest.testReciprocalInf() and ComplexTest.testReciprocalZero() that will no longer evaluate correctly
Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/ec3bb9ed
Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/ec3bb9ed
Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/ec3bb9ed
Branch: refs/heads/complex-dev
Commit: ec3bb9ed9c15dffb3eb7ebef7c53e005c366f0fa
Parents: 2d273aa
Author: Eric Barnhill <er...@apache.org>
Authored: Thu Aug 31 10:05:04 2017 +0200
Committer: Eric Barnhill <er...@apache.org>
Committed: Thu Aug 31 10:05:04 2017 +0200
----------------------------------------------------------------------
.../java/org/apache/commons/numbers/complex/Complex.java | 8 --------
1 file changed, 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/ec3bb9ed/commons-numbers-complex/src/main/java/org/apache/commons/numbers/complex/Complex.java
----------------------------------------------------------------------
diff --git a/commons-numbers-complex/src/main/java/org/apache/commons/numbers/complex/Complex.java b/commons-numbers-complex/src/main/java/org/apache/commons/numbers/complex/Complex.java
index 5a77a9f..7fcbbf4 100644
--- a/commons-numbers-complex/src/main/java/org/apache/commons/numbers/complex/Complex.java
+++ b/commons-numbers-complex/src/main/java/org/apache/commons/numbers/complex/Complex.java
@@ -352,14 +352,6 @@ in the
* @see #divide(Complex)
*/
public Complex reciprocal() {
- if (real == 0.0 && imaginary == 0.0) {
- return INF;
- }
-
- if (Double.isInfinite(real) || Double.isInfinite(imaginary)) {
- return ZERO;
- }
-
if (Math.abs(real) < Math.abs(imaginary)) {
double q = real / imaginary;
double scale = 1. / (real * q + imaginary);