[Bug 2644] [F+O] Conversion from float/double to string

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





------- Additional Comments From mike@saxonica.com  2006-01-26 15:57 -------
The meeting on 24/1/2006 decided on option A, and I was asked to propose
concrete wording to implement this. Here is the proposed wording.

In F+), section 17.1.2, bullet 4 subbullet 3 add a new subbullet 1

* TV will be a string in the lexical space of xs:double or xs:float that when
converted to an xs:double or xs:float under the rules of section 17.1.1 produces
a value that is equal to SV. In addition, TV must satisfy the constraints in the
following sub-bullets.

In the current subsubbullet3, replace the current text including the Note that
follows it by:

* If SV is NaN, TV is the string "NaN".

* If SV is positive or negative infinity, TV is the string "INF" or "-INF"
respectively

* In other cases, the result consists of a mantissa, which has the lexical form
of an xs:decimal, followed by the letter "E", followed by an exponent which has
the lexical form of an xs:integer. Leading zeroes and "+" signs are prohibited
in the exponent. For the mantissa, there must be a decimal point, and there must
be exactly one digit before the decimal point, which must be non-zero. The  "+"
sign is prohibited. There must be at least one digit after the decimal point.
Apart from this mandatory digit, trailing zero digits are prohibited. 

Note:

The above rules allow more than one representation of the same value. For
example the xs:float value whose exact decimal representation is 1.26743223E15
might be represented by any of the strings "1.26743223E15", "1.26743222E15" or
"1.26743224E15" (inter alia). It is implementation-dependent which of these
representations is chosen.

Received on Thursday, 26 January 2006 15:57:33 UTC