ES Decimal status
brendan at mozilla.org
Wed Sep 24 09:17:40 PDT 2008
On Sep 24, 2008, at 9:01 AM, Mike Cowlishaw wrote:
>> I'm not sure what you are getting at. a and a[1.000] refer to the
>> same property in ECMAScript, but a[1m] and a[1.000m] would not. Are
>> you saying this isn't a problem?
> Absolutely not a problem ... many languages (and ES itself) which
> 'arrays' by strings treat the index "1.000" as different from "1", and
> this is not considered a problem.
But they do not treat 1.000 as an index differently from 1. Explicit
string indexes, whether literally expressed or computed, are not the
> This is, no doubt, because if one is treating array indexes as a
> set of
> integers you use integer operations on those indexes (almost
> +, -, and *). If one does use a divide,
Maciej pointed out reciprocal multiplication as strength-reduced
division; this is done often enough in graphics and other low-level
> it would be carefully chosen to
> produce an integer result;
But what if scale is preserved?
> anything which produced a result without an
> exponent of 0 would always be more likely to give a non-zero
> fraction that
> .0, .00, .000, etc. -- and those non-zero ones would fail rapidly.
Sorry, I didn't follow this ("that" should be "than"?).
More information about the Es-discuss