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 2020/04/05 12:44:07 UTC

[commons-numbers] 02/06: Ensure the PrecisionTest covers using 0 ulps for absolute equality.

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 <ah...@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));
             }