Menu

#523 Casting big integer to xs:long

v8.7.1
closed
5
2012-10-08
2006-05-19
Michael Kay
No

When a big integer value is cast to xs:long (using
either a cast expression or a constructor function),
the effect is a no-op: the supplied value is not
checked to be in range, and is returned with its
original type annotation.

Here "big integer" means any xs:integer value that is
internally represented as a BigIntegerValue. This may
be because it was supplied as an integer literal bigger
than a long, or because it was computed using an
arithmetic expression capable of returning a value
bigger than a long.

Source fix: in module
net.sf.saxon.value.BigIntegerValue, method
convertPrimitive, remove the case label "case
Type.LONG" from its current position, and insert it
into the group of case labels that includes "case
Type.NON_POSITIVE_INTEGER".

Discussion