You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2019/12/24 22:31:10 UTC
[commons-numbers] 02/09: Change pow() overflow edge case test.
This is an automated email from the ASF dual-hosted git repository.
aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-numbers.git
commit 9b18dc0457bde8303cc3e96da1fda8ff7e956b5d
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Mon Dec 23 00:09:14 2019 +0000
Change pow() overflow edge case test.
Some libraries can compute (MAX, 1).pow(2, 0) as non-infinite in the
imaginary part by using a decomposition of:
e^a * sin(im) = sin(im) * e^n * e^(a-n)
with n set to not overflow to inf.
---
.../org/apache/commons/numbers/complex/ComplexEdgeCaseTest.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/ComplexEdgeCaseTest.java b/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/ComplexEdgeCaseTest.java
index 4bfbabd..86d8e00 100644
--- a/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/ComplexEdgeCaseTest.java
+++ b/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/ComplexEdgeCaseTest.java
@@ -429,8 +429,8 @@ public class ComplexEdgeCaseTest {
assertComplex(1, 1, nan, 1, name, operation, nan, nan);
assertComplex(1, 1, 1, nan, name, operation, nan, nan);
- // Test overflow
- assertComplex(Double.MAX_VALUE, 1, 2, 0, name, operation, inf, inf);
- assertComplex(1, Double.MAX_VALUE, 2, 0, name, operation, -inf, inf);
+ // Test overflow.
+ assertComplex(Double.MAX_VALUE, 1, 2, 2, name, operation, inf, -inf);
+ assertComplex(1, Double.MAX_VALUE, 2, 2, name, operation, -inf, inf);
}
}