From 9518f3f3026165e522b8452753f8038c937ef153 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Fri, 13 Sep 2013 05:16:54 +0000 Subject: [PATCH] ICU-10273 IBM i fixes X-SVN-Rev: 34299 --- icu4c/source/i18n/plurrule.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/icu4c/source/i18n/plurrule.cpp b/icu4c/source/i18n/plurrule.cpp index 960bcd2b6aa..846f84ab714 100644 --- a/icu4c/source/i18n/plurrule.cpp +++ b/icu4c/source/i18n/plurrule.cpp @@ -1382,7 +1382,7 @@ void FixedDecimal::init(double n) { void FixedDecimal::init(double n, int32_t v, int64_t f) { - isNegative = n < 0; + isNegative = n < 0.0; source = fabs(n); isNanOrInfinity = uprv_isNaN(source) || uprv_isPositiveInfinity(source); if (isNanOrInfinity) { @@ -1469,7 +1469,7 @@ int32_t FixedDecimal::decimals(double n) { // and can easily return noise digits when the precision of a double is exceeded. int64_t FixedDecimal::getFractionalDigits(double n, int32_t v) { - if (v == 0 || n == floor(n)) { + if (v == 0 || n == floor(n) || uprv_isNaN(n) || uprv_isPositiveInfinity(n)) { return 0; } n = fabs(n); -- 2.40.0