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

RE: Canonical lexical form for float and double

From: Ashok Malhotra <ashokma@microsoft.com>
Date: Thu, 29 Nov 2001 14:09:13 -0800
Message-ID: <E5B814702B65CB4DA51644580E4853FB014885D8@red-msg-12.redmond.corp.microsoft.com>
To: "Dave Peterson" <davep@acm.org>, <www-xml-schema-comments@w3.org>
Thank you, Dave.  I agree.  Just wanted a second opinion.


On your second point, you are correct that a value in a float/double
value space is, in fact,

representing an infinite number of real numbers that are approximated to
that value.

I recall that we have an issue on how this fact impacts the definition
of the canonical form but

decided to postpone it as no one seemed to have a brilliant resolution.

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


-----Original Message-----
From: Dave Peterson [mailto:davep@acm.org] 
Sent: Thursday, November 29, 2001 10:25 AM
To: Ashok Malhotra; www-xml-schema-comments@w3.org
Subject: 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


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

Received on Thursday, 29 November 2001 17:10:25 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:49:57 UTC