uschindler commented on PR #12281: URL: https://github.com/apache/lucene/pull/12281#issuecomment-1587138822
I think the related issue found with some vectors creating an NaN cosine (happens when the floats are too large by exponent and the result gets infinity after multiplication) is a separate one. I think we should open an issue. This vector causes the assert to trigger: ``` public void testCosineNaN() { final float[] v = new float[] { 1.E31f }; assertEquals(1f, VectorUtil.cosine(v, v), DELTA); } ``` I figured out that I did not check explicitely for "empty" vectors. I may add a test for that. -- 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