summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorYukio Siraichi <yukio.siraichi@gmail.com>2020-03-14 02:33:55 +0900
committerMike Kaganski <mike.kaganski@collabora.com>2020-03-14 09:10:34 +0100
commit8f8b64cad377c6d767cdf291fd00225658bd02c5 (patch)
treede5f87582bf88b030f57742109aaa289f18e428c /sal
parent2eb0e7594cc875dd0960822d9403b573ac00f739 (diff)
tdf#130974 replace `rtl::math::isSignBitSet` with `std::signbit`.
Change-Id: I91235eee8c6a9d4a59c1933527b49141f64cd91b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90478 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sal')
-rw-r--r--sal/qa/rtl/math/test-rtl-math.cxx22
-rw-r--r--sal/rtl/math.cxx6
2 files changed, 14 insertions, 14 deletions
diff --git a/sal/qa/rtl/math/test-rtl-math.cxx b/sal/qa/rtl/math/test-rtl-math.cxx
index 43d8e90afffc..df899634892e 100644
--- a/sal/qa/rtl/math/test-rtl-math.cxx
+++ b/sal/qa/rtl/math/test-rtl-math.cxx
@@ -173,7 +173,7 @@ public:
CPPUNIT_ASSERT_EQUAL(rtl_math_ConversionStatus_Ok, status);
CPPUNIT_ASSERT_EQUAL(sal_Int32(2), end);
CPPUNIT_ASSERT_EQUAL(0.0, res);
- CPPUNIT_ASSERT(rtl::math::isSignBitSet(res));
+ CPPUNIT_ASSERT(std::signbit(res));
// Compensating: "0.001E311" is 1E308, not overflow/inf
res = rtl::math::stringToDouble(OUString("0.001E311"), '.', ',', &status, &end);
@@ -399,10 +399,10 @@ public:
x = -0.0;
res = rtl::math::expm1(x);
CPPUNIT_ASSERT_EQUAL(-0.0,res);
- CPPUNIT_ASSERT_EQUAL(true, rtl::math::isSignBitSet(res));
+ CPPUNIT_ASSERT(std::signbit(res));
rtl::math::setInf( &x, false);
res = rtl::math::expm1(x);
- CPPUNIT_ASSERT_EQUAL(true, std::isinf(res) && !rtl::math::isSignBitSet(res));
+ CPPUNIT_ASSERT_EQUAL(true, std::isinf(res) && !std::signbit(res));
rtl::math::setInf( &x, true);
res = rtl::math::expm1(x);
CPPUNIT_ASSERT_EQUAL(-1.0,res);
@@ -419,13 +419,13 @@ public:
x = -0.0;
res = rtl::math::log1p(x);
CPPUNIT_ASSERT_EQUAL(-0.0,res);
- CPPUNIT_ASSERT_EQUAL(true, rtl::math::isSignBitSet(res));
+ CPPUNIT_ASSERT(std::signbit(res));
rtl::math::setInf( &x, false);
res = rtl::math::log1p(x);
- CPPUNIT_ASSERT_EQUAL(true, std::isinf(res) && !rtl::math::isSignBitSet(res));
+ CPPUNIT_ASSERT_EQUAL(true, std::isinf(res) && !std::signbit(res));
x = -1.0;
res = rtl::math::log1p(x);
- CPPUNIT_ASSERT_EQUAL(true, std::isinf(res) && rtl::math::isSignBitSet(res));
+ CPPUNIT_ASSERT_EQUAL(true, std::isinf(res) && std::signbit(res));
x = -1.1;
res = rtl::math::log1p(x);
CPPUNIT_ASSERT_EQUAL(true, rtl::math::isNan(res));
@@ -452,7 +452,7 @@ public:
CPPUNIT_ASSERT_EQUAL(0.0, rtl::math::acosh(1.0));
res = rtl::math::acosh(std::numeric_limits<double>::infinity()); // +Inf
- CPPUNIT_ASSERT(!rtl::math::isSignBitSet(res));
+ CPPUNIT_ASSERT(!std::signbit(res));
CPPUNIT_ASSERT(std::isinf(res));
// #i97605
@@ -464,13 +464,13 @@ public:
double res;
res = rtl::math::asinh(-std::numeric_limits<double>::infinity()); // -Inf
- CPPUNIT_ASSERT(rtl::math::isSignBitSet(res));
+ CPPUNIT_ASSERT(std::signbit(res));
CPPUNIT_ASSERT(std::isinf(res));
CPPUNIT_ASSERT_EQUAL(0.0, rtl::math::asinh(0.0));
res = rtl::math::asinh(std::numeric_limits<double>::infinity()); // +Inf
- CPPUNIT_ASSERT(!rtl::math::isSignBitSet(res));
+ CPPUNIT_ASSERT(!std::signbit(res));
CPPUNIT_ASSERT(std::isinf(res));
// #i97605
@@ -491,13 +491,13 @@ public:
CPPUNIT_ASSERT(rtl::math::isNan(res));
res = rtl::math::atanh(-1.0); // -Inf
- CPPUNIT_ASSERT(rtl::math::isSignBitSet(res));
+ CPPUNIT_ASSERT(std::signbit(res));
CPPUNIT_ASSERT(std::isinf(res));
CPPUNIT_ASSERT_EQUAL(0.0, rtl::math::atanh(0.0));
res = rtl::math::atanh(1.0); // +Inf
- CPPUNIT_ASSERT(!rtl::math::isSignBitSet(res));
+ CPPUNIT_ASSERT(!std::signbit(res));
CPPUNIT_ASSERT(std::isinf(res));
res = rtl::math::atanh(2.0); // NaN
diff --git a/sal/rtl/math.cxx b/sal/rtl/math.cxx
index 31de7f718b09..d35156aa79e6 100644
--- a/sal/rtl/math.cxx
+++ b/sal/rtl/math.cxx
@@ -236,7 +236,7 @@ void doubleToString(typename T::String ** pResult,
// sign adjustment, instead of testing for fValue<0.0 this will also fetch
// -0.0
- bool bSign = rtl::math::isSignBitSet(fValue);
+ bool bSign = std::signbit(fValue);
if (bSign)
fValue = -fValue;
@@ -1042,7 +1042,7 @@ double SAL_CALL rtl_math_round(double fValue, int nDecPlaces,
return std::round( fValue );
// sign adjustment
- bool bSign = rtl::math::isSignBitSet( fValue );
+ bool bSign = std::signbit( fValue );
if (bSign)
fValue = -fValue;
@@ -1168,7 +1168,7 @@ double SAL_CALL rtl_math_approxValue( double fValue ) SAL_THROW_EXTERN_C()
double fOrigValue = fValue;
- bool bSign = ::rtl::math::isSignBitSet(fValue);
+ bool bSign = std::signbit(fValue);
if (bSign)
fValue = -fValue;