W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2001

Canonical representation of float and double

From: <zongaro@ca.ibm.com>
Date: Tue, 20 Mar 2001 14:49:01 -0500
To: xmlschema-dev@w3.org
Message-ID: <OFD18D0685.9F83B992-ON85256A15.0062D5E1@torolab.ibm.com>

Hello,

     The definition of the canonical lexical representation for the float
data type in the Schema Datatypes PR is as follows (
http://www.w3.org/TR/xmlschema-2/#float):


   3.2.4.2 Canonical representation

   The canonical representation for float is defined by prohibiting certain
   options from the Lexical representation (3.2.4.1). Specifically, the
   exponent must be indicated by "E". Leading zeroes are prohibited in the
   exponent. For the mantissa, the preceding optional "+" sign is
   prohibited and the decimal point is required.  Leading and trailing
   zeroes are prohibited subject to the following: number representations
   must be normalized such that there is a single digit to the left of the
   decimal point and at least a single digit to the right of the decimal
   point.


     Both lexical values 1.0E0 and 1.000000000001E0 appear to conform to
the requirements of the canonical representation, but they both map to the
same value in the value space.  According to the definition of Canonical
Lexical Representation (2.3.1 -
http://www.w3.org/TR/xmlschema-2/#canonical-lexical-representation), the
mapping between the canonical representation and the value space should be
one-to-one.  I think the requirements on the canonical representation for
float need to be more stringent.

     In addition, I believe it needs to be explicitly stated that the
optional "+" preceding the exponent is prohibited in the canonical
representation.

     The double type has these same problems.

Thanks,

Henry
------------------------------------------------------------------------
Henry Zongaro      XML Parsers development
IBM SWS Toronto Lab   Tie Line 778-6044;  Phone (416) 448-6044
mailto:zongaro@ca.ibm.com
Received on Tuesday, 20 March 2001 14:48:22 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:20 GMT