You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2022/04/28 22:25:52 UTC

[GitHub] [lucene] vigyasharma commented on a diff in pull request #848: LUCENE-10530: Avoid floating point precision bug in TestTaxonomyFacetAssociations

vigyasharma commented on code in PR #848:
URL: https://github.com/apache/lucene/pull/848#discussion_r861353455


##########
lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetAssociations.java:
##########
@@ -500,10 +500,7 @@ private void validateFloats(
       assertNull(facetResult);
     } else {
       assertEquals(dim, facetResult.dim);
-      // We can expect the floats to be exactly equal here since we're ensuring that we sum them
-      // in the same order when determining expected values and when computing facets. See
-      // LUCENE-10530:
-      assertEquals(aggregatedValue, facetResult.value.floatValue(), 0f);
+      assertEquals(aggregatedValue, facetResult.value.floatValue(), 1f);

Review Comment:
   +1, I was going to comment this in the last iteration. There may also be some internal drift in the way aggregation function works on floats. Found a nice read on it [here](https://www.reidatcheson.com/statistics/floating%20point/error/2018/01/15/float-sum-errors.html).



-- 
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-unsubscribe@lucene.apache.org

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


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