diff options
-rw-r--r-- | chromium/third_party/icu/README.chromium | 1 | ||||
-rw-r--r-- | chromium/third_party/icu/source/i18n/gregoimp.cpp | 5 | ||||
-rw-r--r-- | chromium/third_party/icu/source/i18n/gregoimp.h | 11 |
3 files changed, 17 insertions, 0 deletions
diff --git a/chromium/third_party/icu/README.chromium b/chromium/third_party/icu/README.chromium index 975868d39ea..44e0600316a 100644 --- a/chromium/third_party/icu/README.chromium +++ b/chromium/third_party/icu/README.chromium @@ -310,6 +310,7 @@ D. Local Modifications 13. Persian calendar range fix. + https://ssl.icu-project.org/trac/changeset/40654 http://crbug.com/774382 - patches/persian_cal.patch (fixed in ICU 60.1) diff --git a/chromium/third_party/icu/source/i18n/gregoimp.cpp b/chromium/third_party/icu/source/i18n/gregoimp.cpp index e62044b361a..537aa19d8a4 100644 --- a/chromium/third_party/icu/source/i18n/gregoimp.cpp +++ b/chromium/third_party/icu/source/i18n/gregoimp.cpp @@ -27,6 +27,11 @@ int32_t ClockMath::floorDivide(int32_t numerator, int32_t denominator) { numerator / denominator : ((numerator + 1) / denominator) - 1; } +int64_t ClockMath::floorDivide(int64_t numerator, int64_t denominator) { + return (numerator >= 0) ? + numerator / denominator : ((numerator + 1) / denominator) - 1; +} + int32_t ClockMath::floorDivide(double numerator, int32_t denominator, int32_t& remainder) { double quotient; diff --git a/chromium/third_party/icu/source/i18n/gregoimp.h b/chromium/third_party/icu/source/i18n/gregoimp.h index b30741679df..afaacda0b41 100644 --- a/chromium/third_party/icu/source/i18n/gregoimp.h +++ b/chromium/third_party/icu/source/i18n/gregoimp.h @@ -41,6 +41,17 @@ class ClockMath { static int32_t floorDivide(int32_t numerator, int32_t denominator); /** + * Divide two integers, returning the floor of the quotient. + * Unlike the built-in division, this is mathematically + * well-behaved. E.g., <code>-1/4</code> => 0 but + * <code>floorDivide(-1,4)</code> => -1. + * @param numerator the numerator + * @param denominator a divisor which must be != 0 + * @return the floor of the quotient + */ + static int64_t floorDivide(int64_t numerator, int64_t denominator); + + /** * Divide two numbers, returning the floor of the quotient. * Unlike the built-in division, this is mathematically * well-behaved. E.g., <code>-1/4</code> => 0 but |