Canonical Lexical Form for Float and Double -- revised

Here is an improved proposal courtesy Andrew Layman:

The existing text for the lexical representation for float/double reads:

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.  Positive zero is represented
by '0.0E1' and negative zero by '-0.0E1'.

All the best, Ashok 
===========================================================
Ashok Malhotra              <mailto: ashokma@microsoft.com> 
Microsoft Corporation

Received on Thursday, 29 November 2001 18:47:09 UTC