ecma402 icon indicating copy to clipboard operation
ecma402 copied to clipboard

Revisiting limits on Intl Mathematical Value

Open sffc opened this issue 4 months ago • 3 comments

In https://github.com/tc39/proposal-intl-numberformat-v3/pull/128, we chose limits on Intl MV based on the range of a Number but with additional significant digits.

@waldemarhorwat raised concerns that this limit, being smaller than the largest Decimal128, is too limiting.

Let's discuss here what the limits are better off being.

Related: https://github.com/tc39/proposal-measure/issues/37, https://github.com/tc39/proposal-measure/issues/27

CC @jessealama @eemeli

sffc avatar Jul 30 '25 02:07 sffc

Any real number v is representable in IEEE 754 Decimal128 provided there exists an integer q for which

  1. -6176 ≤ q ≤ 6111, and
  2. v × 10−q is an integer n such that 0 < |n| < 1034

We would need to increase the Intl.NF significant digit limit to 34, and possibly some other limits, too.

jessealama avatar Jul 30 '25 14:07 jessealama

Are there limits that underlying ICU4C or ICU4X implementations would impose, that ought to be taken into account here?

eemeli avatar Jul 30 '25 16:07 eemeli

ICU4X limits magnitude to the range [-2^15, 2^15 - 1], where each significant digit is assigned to a magnitude in that range.

As an implementer, I would rather the ECMA upper limit be a bit smaller than that, because I don't want to get too close to the hard limit.

sffc avatar Jul 31 '25 05:07 sffc