Decimal::toString should not round integer value.
authoryosin@chromium.org <yosin@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Jul 2012 08:09:45 +0000 (08:09 +0000)
committeryosin@chromium.org <yosin@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Jul 2012 08:09:45 +0000 (08:09 +0000)
commite4d86ed35021d30fab388819d84ca2290fe1f913
tree84f0b4bb5d6ddee36afeb72ec9122780dde9ec74
parent6ee19458ebdb99f1e72e0dc6da033d2ddc03ddd6
Decimal::toString should not round integer value.
https://bugs.webkit.org/show_bug.cgi?id=91481

Reviewed by Kent Tamura.

Source/WebCore:

This patch makes Decimal::toString not to round an integer value
before converting string.

Tests: WebKit/chromium/tests/DecimalTest.cpp: DecimalTest.toString

* platform/Decimal.cpp:
(WebCore::Decimal::toString): When the value is an integer, we don't
round coefficient to be DBL_DIG(15) digits because double can
represent an integer without rounding error.

Source/WebKit/chromium:

This patch adds a new test cases for Decimal::toString() for failed
value and maximum coefficient value with various exponent.

* tests/DecimalTest.cpp:
(TEST_F): DecimalTest.toString: Add test cases for big coefficient values.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@122928 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/Decimal.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/tests/DecimalTest.cpp