W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > October to December 2001

Canonical lexical form for float and double

From: Ashok Malhotra <ashokma@microsoft.com>
Date: Thu, 29 Nov 2001 09:50:16 -0800
Message-ID: <E5B814702B65CB4DA51644580E4853FB0104072A@red-msg-12.redmond.corp.microsoft.com>
To: <www-xml-schema-comments@w3.org>
Cc: <davep@acm.org>
It has been brought to my attention that there may be an error in the
specification of the canonical lexical form for float/double.  The
current specification for float is below.  Double is similar.

Specifically, the exponent must be indicated by "E". Leading zeroes and
the preceding optional "+" sign are prohibited in the exponent. For the
mantissa, the preceding optional "+" sign is prohibited and the decimal
point is required. For the exponent, the preceding optional "+" sign is
prohibited. 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.

The problem is that the single digit to the left of the decimal point is
allowed to be zero.  This allows 1.0E1, 0.1E02 and 0.01E3 etc. as legal
canonical representations for the same number.

A proposed resolution to this potential errata is to amend the above
text after the colon as follows:

number representations must be normalized such that there is a single
non-zero digit to the left of the decimal point and at least a single
digit to the right of the decimal point.  Zero is represented by '0.0E1'
and '-0.0E1'.

My one concern is that to represent very large numbers it may not be
possible to have just a single number to the left of the decimal point
in the mantissa.  This needs to be checked.  Dave P, can you help here? 


All the best, Ashok 
===========================================================
Ashok Malhotra              <mailto: ashokma@microsoft.com> 
Microsoft Corporation
Received on Thursday, 29 November 2001 12:51:23 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:12:57 GMT