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

Casting from xs:float to xs:double

From: Ashok Malhotra <ashokma@microsoft.com>
Date: Mon, 17 May 2004 17:02:41 -0700
Message-ID: <EDB607C8AC991F40BE646533A1A673E8021D7D58@RED-MSG-42.redmond.corp.microsoft.com>
To: "public comments" <public-qt-comments@w3.org>
According to appendix B <http://www.w3.org/TR/xquery/>  of the XQuery
spec.

		A value of type xs:float (or any type derived by
restriction from xs:float) can be promoted to the type xs:double. The
result is the xs:double value that is the same as the original value.
This kind of promotion may cause loss of precision.

I'm wondering where the imprecision could come from.  Every xs:float
value can be represented EXACTLY as a xs:double value.
Read IEEE-754 float value can be represented exactly as an IEEE-754
double value.   So where could the loss of precision come from?




All the best, Ashok
Received on Monday, 17 May 2004 20:02:55 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:56:57 UTC