diff options
author | Karl Berry <karl@freefriends.org> | 2022-05-31 01:17:15 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-05-31 01:17:15 +0000 |
commit | 4066e47693c667d91051785d7bbe909d30a8b09c (patch) | |
tree | be535ccab8551ddc1ab65d86e7007bc404573687 /Build/source/libs/icu/icu-src/source/i18n/units_complexconverter.cpp | |
parent | 76b41dbf2d1a8bf3f9563393f8c7570b105405f9 (diff) |
icu 71.1
git-svn-id: svn://tug.org/texlive/trunk@63452 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/icu/icu-src/source/i18n/units_complexconverter.cpp')
-rw-r--r-- | Build/source/libs/icu/icu-src/source/i18n/units_complexconverter.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Build/source/libs/icu/icu-src/source/i18n/units_complexconverter.cpp b/Build/source/libs/icu/icu-src/source/i18n/units_complexconverter.cpp index 78cefbf7ebb..ecbe3c78794 100644 --- a/Build/source/libs/icu/icu-src/source/i18n/units_complexconverter.cpp +++ b/Build/source/libs/icu/icu-src/source/i18n/units_complexconverter.cpp @@ -183,7 +183,7 @@ MaybeStackVector<Measure> ComplexUnitsConverter::convert(double quantity, } else { quantity = remainder; } - } + } } applyRounder(intValues, quantity, rounder, status); @@ -210,7 +210,6 @@ MaybeStackVector<Measure> ComplexUnitsConverter::convert(double quantity, } } - // Transfer values into result and return: for(int32_t i = 0, n = unitsConverters_.length(); i < n; ++i) { U_ASSERT(tmpResult[i] != nullptr); @@ -224,6 +223,12 @@ MaybeStackVector<Measure> ComplexUnitsConverter::convert(double quantity, void ComplexUnitsConverter::applyRounder(MaybeStackArray<int64_t, 5> &intValues, double &quantity, icu::number::impl::RoundingImpl *rounder, UErrorCode &status) const { + if (uprv_isInfinite(quantity) || uprv_isNaN(quantity)) { + // Inf and NaN can't be rounded, and calculating `carry` below is known + // to fail on Gentoo on HPPA and OpenSUSE on riscv64. Nothing to do. + return; + } + if (rounder == nullptr) { // Nothing to do for the quantity. return; |