| Summary: | Number.toPrecision returns a wrong value | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | isol2 |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED WONTFIX | ||
| Severity: | Normal | CC: | ashvayka |
| Priority: | P2 | ||
| Version: | Safari 11 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
|
Description
isol2
2018-07-13 11:16:43 PDT
(In reply to isol2 from comment #0) > I found an issue on a test case using Number.toPrecision that I don’t know > if it is considered as an incompatibility issue between engines or a real > bug example, but according with ES6 specs some values are described as > "approximately" maybe this is a case of it. Thank you for report! This is most certainly a IEEE 754 precision issue like 0.1 + 0.2 != 0.3. The spec prose is worded to highlight the inaccuracy: please see step 10.a of https://tc39.es/ecma262/#sec-number.prototype.toprecision. |