RESOLVED FIXED 44745
Number.toFixed/toExponential/toPrecision are inaccurate.
https://bugs.webkit.org/show_bug.cgi?id=44745
Summary Number.toFixed/toExponential/toPrecision are inaccurate.
Gavin Barraclough
Reported 2010-08-26 20:42:00 PDT
These methods should be using a version of dtoa that can generate results accurate to the requested precision, whereas our version of dtoa is only currently able to support producing results sufficiently accurate to distinguish the value from any other IEEE-754 double precision number.
Attachments
Initial patch, no changelog, need layout test results updating. (18.62 KB, patch)
2010-08-26 20:42 PDT, Gavin Barraclough
no flags
The patch (59.59 KB, patch)
2010-08-27 00:57 PDT, Gavin Barraclough
no flags
Style fixes (59.33 KB, patch)
2010-08-27 01:02 PDT, Gavin Barraclough
oliver: review+
Gavin Barraclough
Comment 1 2010-08-26 20:42:49 PDT
Created attachment 65670 [details] Initial patch, no changelog, need layout test results updating.
Gavin Barraclough
Comment 2 2010-08-27 00:57:55 PDT
Created attachment 65687 [details] The patch
WebKit Review Bot
Comment 3 2010-08-27 00:59:39 PDT
Attachment 65687 [details] did not pass style-queue: Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1 JavaScriptCore/wtf/dtoa.cpp:1656: One line control clauses should not use braces. [whitespace/braces] [4] JavaScriptCore/wtf/DecimalNumber.h:26: #ifndef header guard has wrong style, please use: DecimalNumber_h [build/header_guard] [5] Total errors found: 2 in 15 files If any of these errors are false positives, please file a bug against check-webkit-style.
Gavin Barraclough
Comment 4 2010-08-27 01:02:45 PDT
Created attachment 65688 [details] Style fixes
Oliver Hunt
Comment 5 2010-08-27 01:48:46 PDT
Comment on attachment 65688 [details] Style fixes r=me assuming perf is good
Alexey Proskuryakov
Comment 6 2010-08-27 08:38:01 PDT
How does this relate to bug 16653, bug 16651, bug 31777, bug 24711, bug 14468?
Gavin Barraclough
Comment 7 2010-08-27 12:48:23 PDT
*** Bug 24711 has been marked as a duplicate of this bug. ***
Gavin Barraclough
Comment 8 2010-08-27 12:52:06 PDT
*** Bug 14468 has been marked as a duplicate of this bug. ***
Gavin Barraclough
Comment 9 2010-08-27 12:58:46 PDT
*** Bug 16651 has been marked as a duplicate of this bug. ***
Gavin Barraclough
Comment 10 2010-08-27 13:06:39 PDT
Hey Alexy, (In reply to comment #6) > How does this relate to bug Thanks, good question! > 16653, I don't think we're going to break from the spec here, closing won't fix. > bug 16651, bug 31777, bug 24711, bug 14468? These bugs should all be fixed by this patch.
Gavin Barraclough
Comment 11 2010-08-27 13:13:00 PDT
Fixed in r66245.
Note You need to log in before you can comment on or make changes to this bug.