RE: precision on op:numeric-divide

> 
> 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.

Using printf has been suggested surprisingly often, but of course it loses
far too much precision - it's designed for human display not for
round-tripping.
> 
> 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.
> 
Yes, sadly there is a tradition in the database world of standards
conformance coming rather low down the requirement list. Not quite as low as
with operating systems, but low nonetheless. I'm pretty convinced that
failure to take standards seriously was one of the things that killed the
object database market in its infancy, and I just hope the same doesn't
happen for XML databases.

Michael Kay

Received on Thursday, 11 December 2003 18:27:27 UTC