W3C home > Mailing lists > Public > www-ql@w3.org > October to December 2003

Re: precision on op:numeric-divide

From: Per Bothner <per@bothner.com>
Date: Tue, 09 Dec 2003 21:03:08 -0800
Message-ID: <3FD6A90C.2020207@bothner.com>
To: Damien Fisher <damien@sodatech.com>
Cc: www-ql@w3.org

Damien Fisher wrote:

> But shouldn't the specification make it clear what the intended semantics
> are?

Of course.

> How are people supposed to write implementation-independent queries if the
> minimum level of precision isn't guaranteed?  xs:double follows the IEEE
> standard, and hence, if someone needs to, they can make sure their code
> works on many different platforms easily.  I don't  see how this is possible
> with the xs:decimal functions (as they are currently defined).

I don't expect exact rationals to become part of the XQuery
language specifiction, nor should implementations implement it unless
part of the specification.

I'm just saying it would be reasonable to design a language to handle
exact rational decimals.  Other languages have done it.

> Finally, exact rationals, while perhaps desirable in some cases, can lead to
> an explosion in memory usage if not controlled carefully, since there is no
> upper bound on the precision used in the calculations.  A simple example:
> compute (1/2)^n, for some very large n.

How is this different from 2^n for some very large n?
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/
Received on Wednesday, 10 December 2003 00:13:36 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:17:16 UTC