Skip to content

Conversation

@GuntherRademacher
Copy link
Member

This PR aligns numeric comparison semantics with recent specification changes (qt4cg/qtspecs#2218). Mixed-type numeric comparisons now convert both operands to decimals (except for NaN/INF rules), and untyped atomic values are cast to the primitive numeric base type with a fallback to xs:double when required.

All numeric equal and compare implementations were updated accordingly, and the casting logic centralized.

The following invariant holds for all numeric types:

item1.equal(item2, coll, ii) == (item1.compare(item2, coll, false, ii) == 0)

In principle, equal could be removed or implemented in terms of compare. However, its direct implementation remains slightly simpler and is therefore retained.

Tests have been adapted to the changed semantics.

@ChristianGruen
Copy link
Member

Pushed (5b3dc01, cb86407).

@ChristianGruen ChristianGruen deleted the numeric-comparison branch December 11, 2025 17:24
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.

2 participants