NumberFormat maxSignificantDigits Limit

Isiah Meadows isiahmeadows at gmail.com
Sun Jan 20 21:21:12 UTC 2019


I feel this is probably best asked at https://github.com/tc39/ecma402,
since it seems to imply a potential spec bug.

-----

Isiah Meadows
contact at isiahmeadows.com
www.isiahmeadows.com


On Sun, Jan 20, 2019 at 2:31 PM Anders Rundgren <
anders.rundgren.net at gmail.com> wrote:

> On 2019-01-20 20:18, Ethan Resnick wrote:
> > Hi,
> >
> > Apologies if es-discuss is the wrong venue for this; I've tried first
> poring through the specs and asking online to no avail.
> >
> > My question is: why is the limit for the `maximumSignificantDigits`
> option in the `NumberFormat` API set at 21? This seems rather arbitrary —
> and especially odd to me given that, iiuc, all Numbers in JS, as 64 bit
> floats, can only encode up to 17 significant decimal digits. Is this some
> sort of weird historical artifact of something? Should the rationale be
> documented anywhere?
>
> I don't know for sure but if you input this in a browser debugger it will
> indeed respond with the same 21 [sort of] significant digits
> 999999999999999900000
>
> rgds,
> Anders
> >
> > Thanks!
> >
> > Ethan
> >
> > _______________________________________________
> > es-discuss mailing list
> > es-discuss at mozilla.org
> > https://mail.mozilla.org/listinfo/es-discuss
> >
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20190120/21eff059/attachment.html>


More information about the es-discuss mailing list