This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 3033 - Canonical form for float/double should match F&O semantics.
Summary: Canonical form for float/double should match F&O semantics.
Status: CLOSED WONTFIX
Alias: None
Product: XML Schema
Classification: Unclassified
Component: Datatypes: XSD Part 2 (show other bugs)
Version: 1.1 only
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: C. M. Sperberg-McQueen
QA Contact: XML Schema comments list
URL:
Whiteboard: medium, work
Keywords: changeDeclined, noResponse
Depends on:
Blocks:
 
Reported: 2006-03-21 20:43 UTC by Ashok Malhotra
Modified: 2006-12-08 17:56 UTC (History)
0 users

See Also:


Attachments

Description Ashok Malhotra 2006-03-21 20:43:25 UTC
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.
Comment 1 C. M. Sperberg-McQueen 2006-09-22 13:23:29 UTC
For the record: The earlier discussion referred to in the description of 
the issue may be the one recorded in the minutes from Clearwater, Florida, 
in January 2004 (W3C member-only link):
http://www.w3.org/XML/Group/2004/01/xml-schema-ftf-minutes.html

Those minutes refer to a note from Xan Gregg, but provide no
hyperlink.  The note from Xan may be

  http://lists.w3.org/Archives/Member/w3c-xml-schema-ig/2004Jan/0020.html

(also member-only link). They don't show a formal resolution of the
question.
Comment 2 Dave Peterson 2006-10-25 13:15:59 UTC
The WG considered this at the meeting of 6 Oct and chose not to do so.  Note that, unlike most datatypes, the provided canonical mappings of float and double are given only as examples, not "the specified mapping".

Please let us know if you agree with this resolution of your issue, 
by adding a comment to the issue record and changing the Status of 
the issue to Closed.  Or, if you do not agree with this resolution, 
please add a comment explaining why. If you wish to appeal the WG's 
decision to the Director, then also change the Status of the record 
to Reopened. If you wish to record your dissent, but do not wish to 
appeal the decision to the Director, then change the Status of the 
record to Closed.  If we do not hear from you in the next two weeks, 
we will assume you agree with the WG decision.