G Compatibility with Previous Versions (Non-Normative)

This section summarizes the extent to which this specification is compatible with previous versions.

Version 4.0 of this function library is fully backwards compatible with version 3.1, except as noted below:

  1. In edge cases, when comparing values of different numeric types (for example, xs:double and xs:decimal) where the values are numerically very close, numeric comparison may give different results. In previous versions of the specification, xs:decimal values were converted to xs:double, leading to a possible loss of precision. This could make comparisons non-transitive, leading to problems when grouping (for example using fn:distinct-values, and potentially (depending on the sort algorithm) with sorting. The problem has been fixed by requiring comparisons to be performed based on the exact mathematical value without any loss of precision.

For compatibility issues regarding earlier versions, see the 3.1 version of this specification.