Overflow during computation of arithmetic functions

How is overflow to be handled during the computation of arithmetic
functions?

For example, on implementations that choose to limit the precision of
xs:integer to (signed) 64 bit integers, should

let $max_int := xs:integer("9223372036854775807")
return avg(($max_int, $max_int))

succeed and return $max_int, fail with overflow, or is the behavior
implementation-dependent/defined?




Michael Brundage
xquery@comcast.net

Writing as
Author, "XQuery: The XML Query Language" (Addison-Wesley, to appear 2003)
Co-author, "Professional XML Databases" (Wrox Press, 2000)

not as
Technical Lead
Common Query Runtime/XML Query Processing
WebData XML Team
Microsoft

Received on Thursday, 25 September 2003 13:18:50 UTC