W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > January to March 2006

[Bug 3033] Canonical form for float/double should match F&O semantics.

From: <bugzilla@wiggum.w3.org>
Date: Tue, 21 Mar 2006 20:43:25 +0000
CC:
To: www-xml-schema-comments@w3.org
Message-Id: <E1FLnhN-0001bj-Dt@wiggum.w3.org>

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

           Summary: Canonical form for float/double should match F&O
                    semantics.
           Product: XML Schema
           Version: 1.1 only
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Datatypes: XSD Part 2
        AssignedTo: cmsmcq@w3.org
        ReportedBy: ashok.malhotra@oracle.com
         QAContact: www-xml-schema-comments@w3.org


The algorithm for computing the canonical form from a float/double value in
Schema 1.1 is different from the casting float/double semantics described in
the F&O.   This was something that QT and the Schema WG agreed to and it seems
to have fallen between between the cracks. 

The F&O rules are:
    *  TV will be an xs: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 17.1.1
Casting from xs:string and xs:untypedAtomic produces a value that is equal to
SV, or is "NaN" if SV is NaN. In addition, TV must satisfy the constraints in
the following sub-bullets.
          o  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 according to the rules above, as though using an implementation of
xs:decimal that imposes no limits on the totalDigits or fractionDigits facets.
          o  If SV has the value positive or negative zero, TV is "0" or "-0"
respectively.
          o  If SV is positive or negative infinity, TV is the string "INF" or
"-INF" respectively.
          o  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.
Received on Tuesday, 21 March 2006 20:43:36 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:50:05 UTC