Re: precision on op:numeric-divide

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