W3C home > Mailing lists > Public > public-qt-comments@w3.org > February 2004

[F&O] XSCH-FO-005 Casting xs:double and xs:float to xs:string

From: Xan Gregg <xan.gregg@jmp.com>
Date: Sun, 15 Feb 2004 10:20:14 -0500
Message-Id: <7403DC95-5FCA-11D8-9068-000A95A7F890@jmp.com>
To: public-qt-comments@w3.org

Dear Colleagues,

This comment pertains to the 25 December 2003 internal WD of XQuery 1.0
and XPath 2.0 Functions and Operators, as provided to our WG [1].


Xan Gregg, on behalf of the XML Schema Working Group

XSCH-FO-005 Casting xs:double and xs:float to xs:string (17.7)

We note that F&O does not use the XML Schema canonical
representations of xs:decimal, xs:float, and xs:double.  We
know that XML Schema is under-specified in this area, and we are
working to improve our specification in either errata fixes or a
future version (see our RQ-1,

We suggest that we coordinate efforts to find a mutually
satisfactory resolution.

That aside, we suspect the written descriptions do not have their
intended effect.

       If SV has an absolute value that is greater than or equal to
       0.000001 (one millionth) and less than 1000000 (one million),
       then the value is converted to an xs:decimal and the resulting
       xs:decimal is converted to an xs:string  using the rules above.

The casting to decimal rules imply that casting xs:float("1.1") to
xs:decimal yields 1.10000002384185791015625 which is the exact value of
the float that represents "1.1" (and therefore it is the "numerically
closest" value).  Does this mean casting xs:float("1.1") to string
yields "1.10000002384185791015625"?
Received on Sunday, 15 February 2004 10:20:18 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:17 UTC