Re: xsd:float and xsd:decimal

On Fri, 2002-11-22 at 10:57, Jeremy Carroll wrote:
> 
> 
> 
> We can imagine a test case like the xsd:decimal/xsd:integer case, which
> instead is an "10"^^xsd:float and "10"^^xsd:decimal.
> 
> I believe that the Schema spec is clear and authoritative on this; even if
> the spec's author is not.
> 
> from definition in
> 
> http://www.w3.org/TR/xmlschema-2/#float
> 
> [[
> The basic ·value space· of float consists of the values m × 2^e, where m is
> an integer whose absolute value is less than 2^24, and e is an integer
> between -149 and 104, inclusive.
> ]]
> 
> We set e in this definition to 0, m to the value 10, and we find a value
> that corresponds to "10"^^xsd:float.

I'm somewhat surprised by this (my impression was that the value
space of float was a bunch of open intervals around rationals
or something), but after checking a bunch of details,
I'm convinced.

Please include this in the test stuite.

> (Admittedly the L2V mapping is not
> clarified in the XML schema recommendation).

No? "A literal in the ·lexical space· representing a decimal number d
maps to the normalized value in the ·value space· of float that is
closest to d in the sense defined by [Clinger, WD (1990)]"


> Thus we find that "10"^^xsd:float has 'the value 10 x 2^0'.
> I do not think a reading of that phrase as anything other than the
> well-known, commonly used, number ten is merited. If the spec had wanted
> some strange non-standard representation of values then that should be clear
> from text in the spec.
> 
> Similarly,
> 
> the definition of xsd:decimal is:
> http://www.w3.org/TR/xmlschema-2/#decimal
> and includes
> [[
> The ·value space· of decimal is the set of the values i × 10^-n, where i and
> n are integers such that n >= 0.
> ]]
> 
> Again this has a clear standard meaning, and no indication that any
> non-standard reading is required or permitted.
> Moreover there is a plausible candidate for the value of "10"^^xsd:decimal
> being "the value 10 x 10^-0" (otherwise known as that same number ten).
> 
> (Actually you could chose i=100 and n=1 equally sensibly, and any path that
> suggested that the "value 100 x 10^-1" differs from the "value 10 x 10^-0"
> seems to lead to madness, [well a very nonstandard view of numbers]).
> 
> Thus, reading the authoritative specs we work out what the values are, and
> they are the same. Hence, independent of whether our implementations
> actually do it, the relevant entailments are part of RDF datatyping.
> 
> Jeremy

-- 
Dan Connolly, W3C http://www.w3.org/People/Connolly/

Received on Friday, 22 November 2002 12:52:45 UTC