tc39 / proposal-intl-numberformat-v3

Additional features for Intl.NumberFormat to solve key pain points.
MIT License
53 stars 12 forks source link

`FormatNumericToString` will errantly convert -0 to +0 then back to -0 before calling `ToRaw[Precision|Fixed]` #127

Closed trflynn89 closed 1 year ago

trflynn89 commented 1 year ago

The FormatNumericToString will do the following if x is negative-zero:

1. If x is negative-zero, then
    a. Let isNegative be true.
    b. Set x to 0.
2. Else,
   ...
3. If isNegative, then
    a. Let x be -x.

So x will be set to 0 in step 1b, then back to -0 in step 3a. This seems to break the assumptions of the AOs x is later used in, e.g. ToRawPrecision and ToRawFixed state that x "must be a finite non-negative mathematical value".

Should step 3 be a substep of step 2?

sffc commented 1 year ago

Good catch :)

129