Out-of-range decimal literals

Waldemar Horwat waldemar at google.com
Mon Sep 22 17:27:10 PDT 2008

Mike Cowlishaw wrote:
>>> Languages have "personalities", and people build up expectations based
>>> on these characteristics.  As much as possible, I'd like to suggest
>>> that ECMAScript be internally consistent, and not have one independent
>>> choice (binary vs decimal) have unexpected implications over another
>>> (signaling vs quiet operations).
>> The decimal literals introduces a new feature, a type suffix for a
>> number, to explicitly specify the type of the literal. It may well be
>> possible that this is not the last suffix to be added to ES. If, for
>> example, there would be a suffix to denote 32 bit int, it would be
>> very strange to allow to write 5000000000i. Another possibility is
>> support for exact binary floating point literals. Here again rounding
>> out-of-range literals would look strange as the programmer would
>> bother to write the number on purpose to get exact presentation.
> For exact binary floating point literals there probably isn't a problem as 
> one would presumably use the hexadecimal format in IEEE 754 (the same as 
> in C) -- and it's fairly clearly an error if too may bits are specified 
> for the significand.  However, I suppose longer significands could be 
> allowed and rounded -- although that is very much against the concept of 
> exact literals.

Speaking of which, that one is required in IEEE 754r.  What is our implementation of it if we upgrade our reference from 754 to 754r?


More information about the Es-discuss mailing list