Fix float/double facet checks to use native comparison instead of compareTo#1664
Open
gdesrosiers1805 wants to merge 1 commit intoapache:mainfrom
Open
Fix float/double facet checks to use native comparison instead of compareTo#1664gdesrosiers1805 wants to merge 1 commit intoapache:mainfrom
gdesrosiers1805 wants to merge 1 commit intoapache:mainfrom
Conversation
stevedlawrence
requested changes
May 4, 2026
Member
stevedlawrence
left a comment
There was a problem hiding this comment.
Minor changes to the code, would prefer to see TDML tests instead of the custom tests.
stevedlawrence
requested changes
May 4, 2026
Member
stevedlawrence
left a comment
There was a problem hiding this comment.
Minor changes to the code, would prefer to see TDML tests instead of the custom tests.
3d21fc4 to
eaf3845
Compare
stevedlawrence
approved these changes
May 6, 2026
Member
stevedlawrence
left a comment
There was a problem hiding this comment.
+1 with fix to not ignore unexpected validation errors
…pareTo Float|Double.compareTo define a total order where NaN > all values and -0.0 < +0.0, which violates XSD semantics. XSD requires NaN to be incomparable (failing all facets) and -0.0 to equal +0.0. - Replace f.compareTo()/d.compareTo() with native f >= and d >= (and corresponding >, <=, <) so that minInclusive, maxInclusive, minExclusive, and maxExclusive correctly handle NaN, +/-INF, and -0.0 for xs:float and xs:double types. - Add unit tests to Facets.tdml covering all four facets for xs:float and xs:double, exercising IEEE 754 special values: NaN, +INF, -INF, and -0.0. DAFFODIL-3072
eaf3845 to
5a3ed14
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Float|Double.compareTo define a total order where NaN > all values and
-0.0 < +0.0, which violates XSD semantics. XSD requires NaN to be
incomparable (failing all facets) and -0.0 to equal +0.0.