SHA256
1
0
forked from pool/icu
icu/icu-avoid-x87-excess-precision.diff

25 lines
886 B
Diff

---
source/i18n/plurrule.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: icu/source/i18n/plurrule.cpp
===================================================================
--- icu.orig/source/i18n/plurrule.cpp
+++ icu/source/i18n/plurrule.cpp
@@ -1566,13 +1566,13 @@ int64_t FixedDecimal::getFractionalDigit
return 0;
}
n = fabs(n);
- double fract = n - floor(n);
+ volatile double fract = n - floor(n);
switch (v) {
case 1: return (int64_t)(fract*10.0 + 0.5);
case 2: return (int64_t)(fract*100.0 + 0.5);
case 3: return (int64_t)(fract*1000.0 + 0.5);
default:
- double scaled = floor(fract * pow(10.0, (double)v) + 0.5);
+ volatile double scaled = floor(fract * pow(10.0, (double)v) + 0.5);
if (scaled > U_INT64_MAX) {
return U_INT64_MAX;
} else {