[Libreoffice-commits] core.git: sal/qa
Stephan Bergmann
sbergman at redhat.com
Wed Jan 13 08:08:14 PST 2016
sal/qa/rtl/math/test-rtl-math.cxx | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
New commits:
commit e5d393cf0edc5d871cfe1aea6acede482eecec84
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed Jan 13 17:07:10 2016 +0100
Keep MSVC happy
(warning C4305 when converting 9007199254740993 from __int64 to double)
Change-Id: I0e2b92a01ba5ae1824d609ee2e557f1a1cc85cbd
diff --git a/sal/qa/rtl/math/test-rtl-math.cxx b/sal/qa/rtl/math/test-rtl-math.cxx
index 51a655f..47736f1 100644
--- a/sal/qa/rtl/math/test-rtl-math.cxx
+++ b/sal/qa/rtl/math/test-rtl-math.cxx
@@ -89,7 +89,7 @@ public:
}
void test_doubleToString() {
- double fVal = 999999999999999;
+ double fVal = 999999999999999.0;
sal_Int32 aGroups[3] = { 3, 2, 0 };
rtl::OUString aRes( rtl::math::doubleToUString( fVal,
rtl_math_StringFormat_Automatic,
@@ -97,31 +97,31 @@ public:
'.', aGroups, ',', true));
CPPUNIT_ASSERT_EQUAL( OUString("99,99,99,99,99,99,999"), aRes);
- fVal = 4503599627370495;
+ fVal = 4503599627370495.0;
aRes = rtl::math::doubleToUString( fVal,
rtl_math_StringFormat_Automatic,
rtl_math_DecimalPlaces_Max, '.');
CPPUNIT_ASSERT_EQUAL( OUString("4503599627370495"), aRes);
- fVal = 4503599627370496;
+ fVal = 4503599627370496.0;
aRes = rtl::math::doubleToUString( fVal,
rtl_math_StringFormat_Automatic,
2, '.');
CPPUNIT_ASSERT_EQUAL( OUString("4503599627370496.00"), aRes);
- fVal = 9007199254740991; // (2^53)-1
+ fVal = 9007199254740991.0; // (2^53)-1
aRes = rtl::math::doubleToUString( fVal,
rtl_math_StringFormat_Automatic,
rtl_math_DecimalPlaces_Max, '.', true);
CPPUNIT_ASSERT_EQUAL( OUString("9007199254740991"), aRes);
- fVal = 9007199254740992; // (2^53), algorithm switch
+ fVal = 9007199254740992.0; // (2^53), algorithm switch
aRes = rtl::math::doubleToUString( fVal,
rtl_math_StringFormat_Automatic,
rtl_math_DecimalPlaces_Max, '.', true);
CPPUNIT_ASSERT_EQUAL( OUString("9.00719925474099E+015"), aRes);
- fVal = 9007199254740993; // (2^53)+1 would be but is 9007199254740992
+ fVal = 9007199254740993.0; // (2^53)+1 would be but is 9007199254740992
aRes = rtl::math::doubleToUString( fVal,
rtl_math_StringFormat_Automatic,
rtl_math_DecimalPlaces_Max, '.', true);
More information about the Libreoffice-commits
mailing list