Menu

#324 Large values for integer subtypes

v8.3
closed
5
2012-10-08
2005-03-08
Michael Kay
No

There are four built-in subtypes of xs:integer that
allow a semi-infinite range: positiveInteger,
negativeInteger, nonPositiveInteger,
nonNegativeInteger. Also, unsignedLong permits values
that are too large to hold in a Java long. Saxon
supports arbitrarily large values for xs:integer (using
the Java BigInteger class for underlying support).
However, the effect of using large values outside the
long range with these subtypes of xs:integer is
unpredictable. Sometimes they will simply be handled as
if they were xs:integer values, with no constraints on
the range of values and with incorrect type annotations
applied.

Applies to 8.3 and earlier releases, though the actual
behavior may be different between releases.

Source code now fixed. (This is not a simple coding
error, it's more of a design oversight. The code is
assuming that instances of integer subtypes can always
be represented by a Java long).

Michael Kay

Discussion