summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-01-13 17:07:10 +0100
committerStephan Bergmann <sbergman@redhat.com>2016-01-13 17:07:10 +0100
commite5d393cf0edc5d871cfe1aea6acede482eecec84 (patch)
tree33ab82753d27f3e96f22a1cd0ddea8dae81d00a5 /sal
parent036b4a366ecc7ea343a3fedee268463d6576cb32 (diff)
Keep MSVC happy
(warning C4305 when converting 9007199254740993 from __int64 to double) Change-Id: I0e2b92a01ba5ae1824d609ee2e557f1a1cc85cbd
Diffstat (limited to 'sal')
-rw-r--r--sal/qa/rtl/math/test-rtl-math.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/sal/qa/rtl/math/test-rtl-math.cxx b/sal/qa/rtl/math/test-rtl-math.cxx
index 51a655f7df37..47736f1986a3 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);