Re: precision on op:numeric-divide

On 12/10/03 11:44 AM, "Kay, Michael" <Michael.Kay@softwareag.com> wrote:
>> Correct, but I don't think it is the XQuery's WG task to
>> solve the problem of the heterogeneity of arithmetic across
>> different implementation platforms, even though it is tempting...
> 
> And speaking for myself, I think it's a shame we ducked out of this one. It
> wasn't possible to standardize arithmetic with 1970s languages like C and
> SQL because of the sheer variety (and slowness) of hardware, but for a 2000s
> language, the sights have been set too low.
> 
> Most people will be implementing decimal in software anyway, so there are
> very few good excuses for implementations to differ.

The irony is that, for example, XPath completely specifies how doubles
should be converted to string (differing from printf but matching ECMA).  So
in places arithmetic operations are highly specified, and in places they're
not specified at all.

Unfortunately, it probably doesn't really matter what the standard says on
this matter, because most database vendors will deviate from the XQuery
specs if necessary (as they deviate from SQL) to implement whatever
arithmetic rules they already have.  SQL Server, Oracle, and DB2 all have
their idiomatic quirks when it comes to SQL, and I have no reason to expect
XQuery to end up any different.


Cheers,
michael

Received on Thursday, 11 December 2003 04:07:19 UTC