Index: Source/WebCore/platform/Decimal.cpp |
=================================================================== |
--- Source/WebCore/platform/Decimal.cpp (revision 122851) |
+++ Source/WebCore/platform/Decimal.cpp (working copy) |
@@ -628,7 +628,7 @@ |
const int numberOfDigits = countDigits(result); |
const int numberOfDropDigits = -exponent(); |
if (numberOfDigits < numberOfDropDigits) |
- return zero(Positive); |
+ return isPositive() ? Decimal(1) : zero(Positive); |
result = scaleDown(result, numberOfDropDigits - 1); |
if (sign() == Positive && result % 10 > 0) |
@@ -670,7 +670,7 @@ |
const int numberOfDigits = countDigits(result); |
const int numberOfDropDigits = -exponent(); |
if (numberOfDigits < numberOfDropDigits) |
- return zero(Positive); |
+ return isPositive() ? zero(Positive) : Decimal(-1); |
result = scaleDown(result, numberOfDropDigits - 1); |
if (isNegative() && result % 10 > 0) |