Out-of-range decimal literals

Igor Bukanov igor at mir2.org
Thu Sep 18 09:17:48 PDT 2008


2008/9/18 Sam Ruby <rubys at intertwingly.net>:
> 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.


More information about the Es-discuss mailing list