Test #typepromotion-decimal-decimal-pass

In IRC, DanC pointed out:

http://www.w3.org/2001/sw/DataAccess/tests/#typepromotion-decimal-decimal-pass

the core of which is:

datatype("1"^^xsd:unsignedByte + "2"^^xsd:unsignedShort)

The test tests for whether this is xsd:decimal.


http://www.w3.org/TR/xpath-functions/#op.numeric says:

op:operation(xs:integer, xs:integer) ==> xs:integer
   (except for op:numeric-divide(integer, integer), which returns xs:decimal)

op:operation(xs:decimal, xs:decimal) ==>  xs:decimal
op:operation(xs:float, xs:float)     ==> xs:float
op:operation(xs:double, xs:double)   ==> xs:double

and xsd:unsignedByte,xsd:unsignedShort can be used by subtype substitution for 
xsd:integer and no type promotion is necessary.

So I think

   datatype("1"^^xsd:unsignedByte + "2"^^xsd:unsignedShort)

is xsd:integer, not xsd:decimal.

 Andy

Received on Tuesday, 13 December 2005 17:27:37 UTC