You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let e and n be integers such that 10f ≤ n < 10f + 1 and for which n × 10e - n - x is as close to zero as possible. If there are two such sets of e and n, pick the e and n for which n × 10e - f is larger.
This can't be right.
Example: Suppose x, the number we're trying to format, is 123, and f = fractionDigits = 2. The correct output would be "1.23e2", which happens if this step selects n = 123 and e = 2. But the method described above selects n = 123 and e = 125.
It seems to be a typo introduced in #1135. _n_ × 10<sup>_e_ - _n_</sup> - _x_ should be changed back to _n_ × 10<sup>_e_ - _f_</sup> - _x_.
The text was updated successfully, but these errors were encountered:
https://tc39.es/ecma262/#sec-number.prototype.toexponential
step 10.a.i reads:
This can't be right.
Example: Suppose x, the number we're trying to format, is 123, and f = fractionDigits = 2. The correct output would be
"1.23e2"
, which happens if this step selects n = 123 and e = 2. But the method described above selects n = 123 and e = 125.It seems to be a typo introduced in #1135.
_n_ × 10<sup>_e_ - _n_</sup> - _x_
should be changed back to_n_ × 10<sup>_e_ - _f_</sup> - _x_
.The text was updated successfully, but these errors were encountered: