Unit test.
Project: http://git-wip-us.apache.org/repos/asf/commons-numbers/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-numbers/commit/4094c82a Tree: http://git-wip-us.apache.org/repos/asf/commons-numbers/tree/4094c82a Diff: http://git-wip-us.apache.org/repos/asf/commons-numbers/diff/4094c82a Branch: refs/heads/master Commit: 4094c82a9f6c55c03814f648b4b43c5f7e5d0425 Parents: 4d70175 Author: Gilles Sadowski <gil...@harfang.homelinux.org> Authored: Sat Jan 21 19:34:40 2017 +0100 Committer: Gilles Sadowski <gil...@harfang.homelinux.org> Committed: Sat Jan 21 19:34:40 2017 +0100 ---------------------------------------------------------------------- .../org/apache/commons/numbers/complex/ComplexTest.java | 9 +++++++++ 1 file changed, 9 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-numbers/blob/4094c82a/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/ComplexTest.java ---------------------------------------------------------------------- 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 1dbcce1..85f3148 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 @@ -293,6 +293,15 @@ public class ComplexTest { } @Test + public void testReciprocalReciprocal() { + Complex z = new Complex(5.0, 6.0); + Complex zRR = z.reciprocal().reciprocal(); + final double tol = 1e-14; + Assert.assertEquals(zRR.getReal(), z.getReal(), tol); + Assert.assertEquals(zRR.getImaginary(), z.getImaginary(), tol); + } + + @Test public void testReciprocalReal() { Complex z = new Complex(-2.0, 0.0); Assert.assertTrue(Complex.equals(new Complex(-0.5, 0.0), z.reciprocal()));