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 2019/10/03 15:27:20 UTC
[commons-numbers] 01/02: Unit tests.
This is an automated email from the ASF dual-hosted git repository.
erans pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-numbers.git
commit 37e221a79e2a78a99130ae0602c295c45d50ca10
Author: Gilles Sadowski <gi...@harfang.homelinux.org>
AuthorDate: Thu Oct 3 16:20:46 2019 +0200
Unit tests.
---
.../org/apache/commons/numbers/complex/ComplexTest.java | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/ComplexTest.java b/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/ComplexTest.java
index be763f9..c554313 100644
--- a/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/ComplexTest.java
+++ b/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/ComplexTest.java
@@ -587,6 +587,23 @@ public class ComplexTest {
}
@Test
+ public void testScalarPowZeroBaseZeroExponent() {
+ Complex x = Complex.ZERO;
+ double yDouble = 0;
+ Assertions.assertEquals(NAN, x.pow(yDouble));
+ Complex yComplex = Complex.ofReal(yDouble);
+ Assertions.assertEquals(NAN, x.pow(yComplex));
+ }
+ @Test
+ public void testScalarPowZeroBasePositiveExponent() {
+ Complex x = Complex.ZERO;
+ double yDouble = Double.MIN_VALUE;
+ Assertions.assertEquals(Complex.ZERO, x.pow(yDouble));
+ Complex yComplex = Complex.ofReal(yDouble);
+ Assertions.assertEquals(Complex.ZERO, x.pow(yComplex));
+ }
+
+ @Test
public void testScalarPowNaNExponent() {
Complex x = Complex.ofCartesian(3, 4);
double yDouble = Double.NaN;