commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aherb...@apache.org
Subject [commons-numbers] 02/06: Ensure the PrecisionTest covers using 0 ulps for absolute equality.
Date Sun, 05 Apr 2020 12:44:07 GMT
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 791aa8d1f5173bf8ff34414c9559c26b044ec367
Author: Alex Herbert <aherbert@apache.org>
AuthorDate: Sun Apr 5 12:05:27 2020 +0100

    Ensure the PrecisionTest covers using 0 ulps for absolute equality.
---
 .../src/test/java/org/apache/commons/numbers/core/PrecisionTest.java    | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/commons-numbers-core/src/test/java/org/apache/commons/numbers/core/PrecisionTest.java
b/commons-numbers-core/src/test/java/org/apache/commons/numbers/core/PrecisionTest.java
index ee2f90a..92e193f 100644
--- a/commons-numbers-core/src/test/java/org/apache/commons/numbers/core/PrecisionTest.java
+++ b/commons-numbers-core/src/test/java/org/apache/commons/numbers/core/PrecisionTest.java
@@ -150,6 +150,7 @@ public class PrecisionTest {
             Assertions.assertFalse(fun.equals(value, Math.nextDown(Math.nextDown(value)),
1));
             // This test is conditional
             if (!fixed1Ulp) {
+                Assertions.assertFalse(fun.equals(value, Math.nextUp(value), 0));
                 Assertions.assertTrue(fun.equals(value, Math.nextUp(Math.nextUp(value)),
2));
                 Assertions.assertTrue(fun.equals(value, Math.nextDown(Math.nextDown(value)),
2));
             }
@@ -248,6 +249,7 @@ public class PrecisionTest {
             Assertions.assertFalse(fun.equals(value, Math.nextDown(Math.nextDown(value)),
1));
             // This test is conditional
             if (!fixed1Ulp) {
+                Assertions.assertFalse(fun.equals(value, Math.nextUp(value), 0));
                 Assertions.assertTrue(fun.equals(value, Math.nextUp(Math.nextUp(value)),
2));
                 Assertions.assertTrue(fun.equals(value, Math.nextDown(Math.nextDown(value)),
2));
             }


Mime
View raw message