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
We took a quick look into this issue. The conversion from string to number is done using strtod from the venerable dtoa library. Given the complexity of implementing that correctly, you'll understand that we try to avoid modifying that code. Some possibilities:
A mismatch between the behavior required by Ecma-262 and what is implemented by strtod
XS is using strtod incorrectly
XS is configuring strtod incorrectly for this case
At one point other engines also used the same library. I'm not sure if that's still the case. If they do, that would be a good reference point to see how they are handling this case.
Environment: XS 13.0.0 32 4
Description
Converting to numbers that require rounding from a literal or string is inconsistent with the ECMAScript specification.
Steps to Reproduce
Actual behavior
Expected behavior
When rounding, ties should resolve to the even IEEE 754 significand: https://tc39.es/ecma262/multipage/ecmascript-data-types-and-values.html#number-value-for (for NumericLiteral via Evaluation → NumericValue → RoundMVResult → [because the decimal representation has 20 or fewer significant digits] 𝔽 → the Number value for x and for string via StringToNumber → StringNumericValue → RoundMVResult).
The text was updated successfully, but these errors were encountered: