Re: Canonical lexical form for float and double

At 9:50 AM -0800 11/29/01, Ashok Malhotra wrote:
>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.

>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?

There is no limit specified in the Rec for the number of digits in an
integer numeral, which is what the exponent part is constrained to be.
Therefore, a very large negative integer can always be selected which
shifts the decimal point enough to give a single digit to the left of
the decimal of the "mantissa" (which, by the way, is a misuse of the
word "mantissa").

Warning:  Unlike most datatypes, decimal and double have a lexical space
which ordinarily would be taken to include numerals naming values that
are not in the value space; rather, they are taken to name the nearest
value that *is* in the value space.  If the value space is restricted,
say to values representable with fewer bits for exponent or "mantissa",
then the numerals originally mapping to the dropped values will *not*
map to the nearest remaining value; they will drop from the lexical
space.  I have no idea under what circumstances this will, as they say,
"screw the pooch".
-- 
Dave Peterson
SGMLWorks!

davep@acm.org

Received on Thursday, 29 November 2001 13:27:51 UTC