W3C home > Mailing lists > Public > public-rif-wg@w3.org > February 2009

conformance in the face of decimals with lengths larger than supported by the implementation

From: Jos de Bruijn <debruijn@inf.unibz.it>
Date: Fri, 13 Feb 2009 13:07:31 +0100
Message-ID: <49956283.1090506@inf.unibz.it>
To: RIF WG <public-rif-wg@w3.org>
xsd:decimal allows decimals of arbitrary length.  However,
implementations are only required to support decimals up to a certain
length.

An implementation may round off a decimal it receives.  So, in some
implementations
1^^decimal=1.0000000000000000000000000001^^decimal
will be always true and in some implementations it will be inconsistent.

These two things hamper interoperability and make the semantics of the
language unpredictable.

I propose to add to conformance that implementations MUST reject RIF
documents that contain decimals (or any subtype thereof) bigger than
supported by the particular implementation.


Yet another problem is that XPath functions and operators states that
the if the "number of digits in the result exceeds the number of digits
that the implementation supports, the result is truncated or rounded in
an implementation-defined manner" [1].
So, in some applications numeric-divide(1^^int,3^^int) returns
0.3333333333333333333^^decimal
and in some applications it returns
0.33333333333333333333333333333333333^^decimal

At the moment I'm not entirely sure how to solve this.  One possibility
would be to define entailment relative to some supported subset of decimal.


Best, Jos

[1] http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#op.numeric
-- 
Jos de Bruijn            debruijn@inf.unibz.it
+390471016224         http://www.debruijn.net/
----------------------------------------------
No one who cannot rejoice in the discovery of
his own mistakes deserves to be called a
scholar.
  - Donald Foster


Received on Friday, 13 February 2009 12:24:27 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 2 June 2009 18:34:03 GMT