From 7c06f078d1d264d1df111de8e02fcd9f952681d63143bcf3e3693b8637330f97 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 7 Aug 2018 12:01:01 +0000 Subject: [PATCH] another try at icu-avoid-x87-excess-precision.diff OBS-URL: https://build.opensuse.org/package/show/X11:common:Factory/icu?expand=0&rev=94 --- icu-avoid-x87-excess-precision.diff | 30 +++++++++++------------------ 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/icu-avoid-x87-excess-precision.diff b/icu-avoid-x87-excess-precision.diff index bc04971..7424ddc 100644 --- a/icu-avoid-x87-excess-precision.diff +++ b/icu-avoid-x87-excess-precision.diff @@ -1,46 +1,38 @@ -From: Jan Engelhardt -Date: 2018-08-06 22:57:07.717647182 +0200 - -getPluralOperand returns double, which causes the other operand to get -upconverted from long long to double, and there seems to be rounding errors on -i586 (possibly from excess precision, aka 80-bit floats). - -Since the result of getPluralOption is printed with %lld at one point, this -suggests that the result is intended to be downconverted to long long instead -of upconverting the LL constant. That's why we do not use a (volatile double) -cast here like in opensuse icu 61. --- - source/test/intltest/dcfmapts.cpp | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) + source/test/intltest/dcfmapts.cpp | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) Index: icu/source/test/intltest/dcfmapts.cpp =================================================================== --- icu.orig/source/test/intltest/dcfmapts.cpp +++ icu/source/test/intltest/dcfmapts.cpp -@@ -851,7 +851,7 @@ void IntlTestDecimalFormatAPI::TestFixed +@@ -851,7 +851,8 @@ void IntlTestDecimalFormatAPI::TestFixed ASSERT_EQUAL(22, fd.getPluralOperand(PLURAL_OPERAND_V)); ASSERT_EQUAL(1234567890123456789LL, fd.getPluralOperand(PLURAL_OPERAND_F)); ASSERT_EQUAL(1234567890123456789LL, fd.getPluralOperand(PLURAL_OPERAND_T)); - ASSERT_EQUAL(345678901234567890LL, fd.getPluralOperand(PLURAL_OPERAND_I)); -+ ASSERT_EQUAL(345678901234567890LL, (long long)fd.getPluralOperand(PLURAL_OPERAND_I)); ++ volatile double xxa = fd.getPluralOperand(PLURAL_OPERAND_I); ++ ASSERT_EQUAL(345678901234567890LL, xxa); ASSERT_EQUAL(FALSE, fd.hasIntegerValue()); ASSERT_EQUAL(FALSE, fd.isNegative()); -@@ -948,13 +948,13 @@ void IntlTestDecimalFormatAPI::TestFixed +@@ -947,14 +948,15 @@ void IntlTestDecimalFormatAPI::TestFixed + // note: going through DigitList path to FixedDecimal, which is trimming // int64_t fields to 18 digits. See ticket Ticket #10374 // ASSERT_EQUAL(223372036854775807LL, fd.getPluralOperand(PLURAL_OPERAND_I); ++ volatile double xxb = fd.getPluralOperand(PLURAL_OPERAND_I); if (!( - fd.getPluralOperand(PLURAL_OPERAND_I) == 223372036854775807LL || - fd.getPluralOperand(PLURAL_OPERAND_I) == 9223372036854775807LL)) { -+ (long long)fd.getPluralOperand(PLURAL_OPERAND_I) == 223372036854775807LL || -+ (long long)fd.getPluralOperand(PLURAL_OPERAND_I) == 9223372036854775807LL)) { ++ xxb == 223372036854775807LL || ++ xxb == 9223372036854775807LL)) { dataerrln( "File %s, Line %d, fd.getPluralOperand(PLURAL_OPERAND_I = %lld", __FILE__, __LINE__, - fd.getPluralOperand(PLURAL_OPERAND_I)); -+ (long long)fd.getPluralOperand(PLURAL_OPERAND_I)); ++ xxb); } ASSERT_EQUAL(TRUE, fd.hasIntegerValue()); ASSERT_EQUAL(FALSE, fd.isNegative());