Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Unified Diff: Source/WebCore/platform/Decimal.cpp

Issue 11420033: Merge 134390 - Unable to set valid time value to input[type=time] with user interaction in some cas… (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1312/
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/html/shadow/DateTimeEditElement.cpp ('k') | Source/WebKit/chromium/tests/DecimalTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/platform/Decimal.cpp
===================================================================
--- Source/WebCore/platform/Decimal.cpp (revision 134891)
+++ Source/WebCore/platform/Decimal.cpp (working copy)
@@ -902,8 +902,8 @@
Decimal Decimal::remainder(const Decimal& rhs) const
{
- const Decimal quotient = (*this / rhs).round();
- return quotient.isSpecial() ? quotient : *this - quotient * rhs;
+ const Decimal quotient = *this / rhs;
+ return quotient.isSpecial() ? quotient : *this - (quotient.isNegative() ? quotient.ceiling() : quotient.floor()) * rhs;
}
Decimal Decimal::round() const
« no previous file with comments | « Source/WebCore/html/shadow/DateTimeEditElement.cpp ('k') | Source/WebKit/chromium/tests/DecimalTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698