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

[Bug 1406] Serialization of float and double via decimal problematic

From: <bugzilla@wiggum.w3.org>
Date: Fri, 13 May 2005 18:00:26 +0000
To: public-qt-comments@w3.org
Cc:
Message-Id: <E1DWeSY-0004cw-J9@wiggum.w3.org>

http://www.w3.org/Bugs/Public/show_bug.cgi?id=1406





------- Additional Comments From mike@saxonica.com  2005-05-13 18:00 -------
I've never really understood how an implementation can get away with only
supporting 18 digits of precision, since xs:unsignedLong requires 20; but that's
incidental.

For format-number() in XSLT 2.0 we specify that the behaviour is as if the
xs:double is converted to an xs:decimal using an implementation of xs:decimal
that supports infinite precision, and we then describe how this notional
xs:decimal is converted to a string. This does not require that the
implementation actually supports such an xs:decimal type, only that
double->string conversion behaves as if it did. I would suggest that we adopt
the same approach here.

Outputting natural numbers such as 1, 2, and 3 in exponential notation is not an
option. Doubles arise all the time as a result of our implicit rules for
handling untyped data; we can't possibly contemplate the output of 

See Chapter <xsl:value-of select="@chap + 1"/>

being "See Chapter 2e0".

Michael Kay
Received on Friday, 13 May 2005 18:00:30 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:14:38 GMT