Re: precision on op:numeric-divide

Per Bothner <[email protected]>
Newsgroups gmane.comp.web.query-languages
Message-ID <[email protected]>
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
[email protected]   http://per.bothner.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.