summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorYukio Siraichi <yukio.siraichi@gmail.com>2020-03-13 15:41:40 +0900
committerMike Kaganski <mike.kaganski@collabora.com>2020-03-14 09:19:00 +0100
commit3bf3face224a7e12ba95888821a0ac21525af22c (patch)
tree93908386dd614404e46898ae16ee179549a1a0f9 /sal
parent8f8b64cad377c6d767cdf291fd00225658bd02c5 (diff)
tdf#130975 replace `rtl::math::isNan` with `std::isnan`.
Change-Id: I5d53e6369d35093445b2efd8936bbf8c6775ff47 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90451 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.cxx26
-rw-r--r--sal/rtl/math.cxx2
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 df899634892e..4843d66c2aec 100644
--- a/sal/qa/rtl/math/test-rtl-math.cxx
+++ b/sal/qa/rtl/math/test-rtl-math.cxx
@@ -65,14 +65,14 @@ public:
'.', ',', &status, &end);
CPPUNIT_ASSERT_EQUAL(rtl_math_ConversionStatus_Ok, status);
CPPUNIT_ASSERT_EQUAL(sal_Int32(3), end);
- CPPUNIT_ASSERT_EQUAL(true, rtl::math::isNan(res));
+ CPPUNIT_ASSERT(std::isnan(res));
res = rtl::math::stringToDouble(
OUString("NaN1.23"),
'.', ',', &status, &end);
CPPUNIT_ASSERT_EQUAL(rtl_math_ConversionStatus_Ok, status);
CPPUNIT_ASSERT_EQUAL(sal_Int32(3), end);
- CPPUNIT_ASSERT_EQUAL(true, rtl::math::isNan(res));
+ CPPUNIT_ASSERT(std::isnan(res));
res = rtl::math::stringToDouble(
OUString("INF"),
@@ -366,7 +366,7 @@ public:
CPPUNIT_ASSERT_EQUAL(-1.0,res);
rtl::math::setNan( &x);
res = rtl::math::erf(x);
- CPPUNIT_ASSERT_EQUAL(true,rtl::math::isNan(res));
+ CPPUNIT_ASSERT(std::isnan(res));
x = 3.0;
res = rtl::math::erf(-x);
CPPUNIT_ASSERT_DOUBLES_EQUAL( -rtl::math::erf(x), res, 1E-12);
@@ -385,7 +385,7 @@ public:
CPPUNIT_ASSERT_EQUAL(2.0,res);
rtl::math::setNan( &x);
res = rtl::math::erfc(x);
- CPPUNIT_ASSERT_EQUAL(true,rtl::math::isNan(res));
+ CPPUNIT_ASSERT(std::isnan(res));
x = 3.0;
res = rtl::math::erfc(-x);
CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 - rtl::math::erfc(x), res, 1E-12);
@@ -408,7 +408,7 @@ public:
CPPUNIT_ASSERT_EQUAL(-1.0,res);
rtl::math::setNan( &x);
res = rtl::math::expm1(x);
- CPPUNIT_ASSERT_EQUAL(true,rtl::math::isNan(res));
+ CPPUNIT_ASSERT(std::isnan(res));
}
void test_log1p() {
@@ -428,26 +428,26 @@ public:
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));
+ CPPUNIT_ASSERT(std::isnan(res));
rtl::math::setInf( &x, true);
res = rtl::math::log1p(x);
- CPPUNIT_ASSERT_EQUAL(true, rtl::math::isNan(res));
+ CPPUNIT_ASSERT(std::isnan(res));
rtl::math::setNan( &x);
res = rtl::math::log1p(x);
- CPPUNIT_ASSERT_EQUAL(true,rtl::math::isNan(res));
+ CPPUNIT_ASSERT(std::isnan(res));
}
void test_acosh() {
double res;
res = rtl::math::acosh(-1.0); // NaN
- CPPUNIT_ASSERT(rtl::math::isNan(res));
+ CPPUNIT_ASSERT(std::isnan(res));
res = rtl::math::acosh(0.0); // NaN
- CPPUNIT_ASSERT(rtl::math::isNan(res));
+ CPPUNIT_ASSERT(std::isnan(res));
res = rtl::math::acosh(0.5); // NaN
- CPPUNIT_ASSERT(rtl::math::isNan(res));
+ CPPUNIT_ASSERT(std::isnan(res));
CPPUNIT_ASSERT_EQUAL(0.0, rtl::math::acosh(1.0));
@@ -488,7 +488,7 @@ public:
double res;
res = rtl::math::atanh(-2.0); // NaN
- CPPUNIT_ASSERT(rtl::math::isNan(res));
+ CPPUNIT_ASSERT(std::isnan(res));
res = rtl::math::atanh(-1.0); // -Inf
CPPUNIT_ASSERT(std::signbit(res));
@@ -501,7 +501,7 @@ public:
CPPUNIT_ASSERT(std::isinf(res));
res = rtl::math::atanh(2.0); // NaN
- CPPUNIT_ASSERT(rtl::math::isNan(res));
+ CPPUNIT_ASSERT(std::isnan(res));
}
CPPUNIT_TEST_SUITE(Test);
diff --git a/sal/rtl/math.cxx b/sal/rtl/math.cxx
index d35156aa79e6..135035e01138 100644
--- a/sal/rtl/math.cxx
+++ b/sal/rtl/math.cxx
@@ -241,7 +241,7 @@ void doubleToString(typename T::String ** pResult,
if (bSign)
fValue = -fValue;
- if (rtl::math::isNan(fValue))
+ if (std::isnan(fValue))
{
// #i112652# XMLSchema-2
sal_Int32 nCapacity = RTL_CONSTASCII_LENGTH("NaN");