W3C home > Mailing lists > Public > www-ql@w3.org > April to June 2003

Re: types of numeric literals and operators

From: Per Bothner <per@bothner.com>
Date: Mon, 23 Jun 2003 08:32:36 -0700
Message-ID: <3EF71D94.10201@bothner.com>
To: Bas de Bakker <bas@x-hive.com>
CC: www-ql@w3.org

Bas de Bakker wrote:

> I suggest giving literals like [0-9]* type xs:int and
> defining arithmetic on long, int, short, byte as in Java.

An alternative is to change the semantics of arithmetic operations such 
that if the operands are xs:int the operation is done using 32-bit 
arithmetic, and that casts to xs:int just gets the lower 32 bits without 
error checking.  Then for example:

define function f ($x as xs:int, $y as xs:integer) as xs:int {
   $x + $y + 1
}

In this case both additions can be done using 32-bit arithmetic.
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/
Received on Monday, 23 June 2003 11:31:01 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:43:42 UTC