[Bug 5183] [FO] Effect of type promotion in fn:distinct-values

http://www.w3.org/Bugs/Public/show_bug.cgi?id=5183





------- Comment #8 from mike@saxonica.com  2007-11-28 18:21 -------
After sitting on this for a while, I propose to resolve this by adding the
paragraph:

If the input sequence contains values of different numeric types that differ
from each other by small amounts, then the eq operator is not transitive,
because of rounding effects occurring during type promotion. In the situation
where the input contains three values A, B, and C such that A eq B, B eq C, but
A ne C, then the number of items in the result of the function (as well as the
choice of which items are returned) is implementation dependent, subject only
to the constraints that (a) no two items in the result sequence compare equal
to each other, and (b) every input item that does not appear in the result
sequence compares equal to some item that does appear in the result sequence. 

For example, this arises when computing 

      distinct-values(
         (xs:float('1.0'),
          xs:decimal('1.0000000000100000000001',
          xs:double( '1.00000000001'))

because the values of type xs:float and xs:double both compare equal to the
value of type xs:decimal but not equal to each other.

For xsl:for-each-group, we need to add similar wording. I will raise a separate
bug report on this. 

Received on Wednesday, 28 November 2007 18:21:39 UTC