stefanvodita commented on code in PR #13723:
URL: https://github.com/apache/lucene/pull/13723#discussion_r1759505470


##########
lucene/CHANGES.txt:
##########
@@ -422,7 +422,9 @@ Build
 
 Other
 --------------------
-(No changes)
+
+* GITHUB#13720: Add float comparison based on unit of least precision and use 
it to stop test failures caused by float
+  summation not being commutative in Java's IEEE 754 implementation. (Alex 
Herbert, Stefan Vodita)

Review Comment:
   Now that I think about it, it's not even a commutativity issue. It's an 
associativity issue.
   `a + b == b + a`
   But
   `(a + b) + c != a + (b + c)`
   I'll fix the entry.
   



##########
lucene/test-framework/src/java/org/apache/lucene/tests/util/LuceneTestCase.java:
##########
@@ -864,6 +864,14 @@ public static void assumeNoException(String msg, Exception 
e) {
     RandomizedTest.assumeNoException(msg, e);
   }
 
+  public static void assertFloatUlpEquals(final float x, final float y, final 
short maxUlps) {
+    assertTrue(TestUtil.floatUlpEquals(x, y, maxUlps));

Review Comment:
   Good point, will do.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to