Skip to content

GH-4297: Fix signed-zero numeric comparisons - #4356

Open
mhatipog wants to merge 2 commits into
apache:mainfrom
mhatipog:fix/gh-4297-signed-zero
Open

mhatipog wants to merge 2 commits into
apache:mainfrom
mhatipog:fix/gh-4297-signed-zero

Conversation

@mhatipog

Copy link
Copy Markdown

GitHub issue resolved #4297

"Float.compare" and "Double.compare" distinguish positive and negative zero, causing incorrect SPARQL numeric comparisons.

Check numeric equality first, before using the Java comparators.

Added regression tests for float, double and mixed numeric types.

Full ARQ reactor tests pass on Java 21 (16,785 tests, 1 skipped).


  • Tests are included.
  • Key commit messages start with the issue number (GH-xxxx).

By submitting this pull request, I acknowledge that I am making a contribution to the Apache Software Foundation under the terms and conditions of the "Contributor's Agreement" (https://www.apache.org/licenses/contributor-agreements.html).

@mhatipog mhatipog changed the title Fix/gh 4297 signed zero GH-4297: Fix signed-zero numeric comparisons Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

+0 = -0 compares false and -0 < +0 compares true for xsd:float/xsd:double

1 participant