Hi Eric.
Changing
0 -> 0.0
is not necessary, and since the latter is less esthetically pleasing,
why bother?
And, as usual, we should avoid mixing different types of changes in
the same commit.
Regards,
Gilles
On Fri, 28 Jul 2017 11:34:47 -, ericbarnh...@apache.org wrote:
Repository: commons-numbers
Updated Branches:
refs/heads/complex-dev af5fc05bb -> 387f4e09b
NUMBERS-13: atanh() passes all tests
Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo
Commit:
http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/a9437c90
Tree:
http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/a9437c90
Diff:
http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/a9437c90
Branch: refs/heads/complex-dev
Commit: a9437c90666ca8c3045f1d59de1b77e536addba6
Parents: af5fc05
Author: Eric Barnhill
Authored: Fri Jul 28 13:24:12 2017 +0200
Committer: Eric Barnhill
Committed: Fri Jul 28 13:24:12 2017 +0200
--
.../apache/commons/numbers/complex/Complex.java | 75
+++-
.../commons/numbers/complex/CStandardTest.java | 4 +-
2 files changed, 44 insertions(+), 35 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/a9437c90/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 fc3ff93..5a77a9f 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
@@ -641,7 +641,7 @@ in the
* @return the inverse cosine of this complex number.
*/
public Complex acos() {
-if (real == 0 && Double.isNaN(imaginary)) {
+if (real == 0.0&& Double.isNaN(imaginary)) {
return new Complex(Math.PI * 0.5, Double.NaN);
} else if (neitherInfiniteNorZeroNorNaN(real) && imaginary
== Double.POSITIVE_INFINITY) {
return new Complex(Math.PI * 0.5,
Double.NEGATIVE_INFINITY);
@@ -704,13 +704,13 @@ in the
if (neitherInfiniteNorZeroNorNaN(real) && imaginary ==
Double.POSITIVE_INFINITY) {
return new Complex(Double.POSITIVE_INFINITY, Math.PI *
0.5);
} else if (real == Double.POSITIVE_INFINITY &&
!Double.isInfinite(imaginary) && !Double.isNaN(imaginary)) {
-return new Complex(Double.POSITIVE_INFINITY, 0);
+return new Complex(Double.POSITIVE_INFINITY, 0.0);
} else if (real == Double.POSITIVE_INFINITY && imaginary ==
Double.POSITIVE_INFINITY) {
return new Complex(Double.POSITIVE_INFINITY, Math.PI *
0.25);
} else if (real == Double.POSITIVE_INFINITY &&
Double.isNaN(imaginary)) {
return new Complex(Double.POSITIVE_INFINITY,
Double.NaN);
-} else if (Double.isNaN(real) && imaginary == 0) {
-return new Complex(Double.NaN, 0);
+} else if (Double.isNaN(real) && imaginary == 0.0) {
+return new Complex(Double.NaN, 0.0);
} else if (Double.isNaN(real) && imaginary ==
Double.POSITIVE_INFINITY) {
return new Complex(Double.POSITIVE_INFINITY,
Double.NaN);
}
@@ -729,10 +729,10 @@ in the
* @since 1.2
*/
public Complex atanh(){
-if (real == 0 && Double.isNaN(imaginary)) {
+if (real == 0.0 && Double.isNaN(imaginary)) {
return new Complex(0, Double.NaN);
-} else if (neitherInfiniteNorZeroNorNaN(real) && imaginary
== 0) {
-return new Complex(Double.POSITIVE_INFINITY, 0);
+} else if (neitherInfiniteNorZeroNorNaN(real) && imaginary
== 0.0) {
+return new Complex(Double.POSITIVE_INFINITY, 0.0);
} else if (neitherInfiniteNorZeroNorNaN(real) && imaginary
== Double.POSITIVE_INFINITY) {
return new Complex(0, Math.PI*0.5);
} else if (real == Double.POSITIVE_INFINITY &&
neitherInfiniteNorZeroNorNaN(imaginary)) {
@@ -808,18 +808,18 @@ in the
* @return the hyperbolic cosine of this complex number.
*/
public Complex cosh() {
-if (real == 0 && imaginary == Double.POSITIVE_INFINITY) {
-return new Complex(Double.NaN, 0);
-} else if (real == 0 && Double.isNaN(imaginary)) {
-return new Complex(Double.NaN, 0);
-} else if (real == Double.POSITIVE_INFINITY && imaginary ==
0) {
-return new Complex(Double.POSITIVE_INFINITY, 0);
+if (real == 0.0&& imaginary == Double.POSITIVE_INFINITY) {
+return new Complex(Double.NaN, 0.0);
+} else if (real == 0.0&& Double.isNaN(imaginary)) {
+re