RESOLVED FIXED Bug 91579
Decimal constructor with 99999999999999999 loses last digit
https://bugs.webkit.org/show_bug.cgi?id=91579
Summary Decimal constructor with 99999999999999999 loses last digit
yosin
Reported 2012-07-17 22:06:23 PDT
There is a bug in Decimal::EncodedData constructor with maximum coefficient, 99999999999999999, in following line: Decimal::EncodedData::EncodedData(Sign sign, int exponent, uint64_t coefficient) { ... if (exponent >= ExponentMin && exponent <= ExponentMax) { while (coefficient >= MaxCoefficient) { // *** BUG, we should use ">" instead of ">=". coefficient /= 10; ++exponent; } } ... }
Attachments
Patch 1 (5.53 KB, patch)
2012-07-17 22:22 PDT, yosin
no flags
yosin
Comment 1 2012-07-17 22:22:34 PDT
yosin
Comment 2 2012-07-17 22:23:31 PDT
Comment on attachment 152918 [details] Patch 1 Could you review this patch? Thanks in advance.
Kent Tamura
Comment 3 2012-07-17 22:36:10 PDT
Comment on attachment 152918 [details] Patch 1 looks ok
yosin
Comment 4 2012-07-17 23:50:34 PDT
Comment on attachment 152918 [details] Patch 1 Clearing flags on attachment: 152918 Committed r122922: <http://trac.webkit.org/changeset/122922>
yosin
Comment 5 2012-07-17 23:50:39 PDT
All reviewed patches have been landed. Closing bug.
Alexey Proskuryakov
Comment 6 2012-07-18 10:41:43 PDT
This is fixing Platform code. Is that code used anywhere? An actual regression test would be vastly preferable to a unit test (which is not even cross-platform!)
yosin
Comment 7 2012-07-18 18:17:17 PDT
(In reply to comment #6) > This is fixing Platform code. Is that code used anywhere? An actual regression test would be vastly preferable to a unit test (which is not even cross-platform!) The code is used in step-able input types, number, date, range, datetime, and so on. Although, it is hard to hit this case from HTML5/JavaScript, because the value is out of range of double. The purpose of fixing this is for test case (bug 91481) and that test case is supplement for LayoutTest.
Note You need to log in before you can comment on or make changes to this bug.