summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorLiu Hao <ianahao331@gmail.com>2022-08-15 18:07:07 +0800
committerEike Rathke <erack@redhat.com>2022-08-19 17:23:59 +0200
commit466f86abb7208e853ad48ae46e97a2455667fa42 (patch)
treee665c0711d1676f61331c16d323e5153a5fa4eee /sal
parent6e97fcf162b8495f0584f0bb67d020b3f3754780 (diff)
tdf#148430 Use std math functions instead of rtl::math
Change-Id: I6bcb33d51c3974d0e8905e1ffeac556a99870aab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138294 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sal')
-rw-r--r--sal/qa/rtl/math/test-rtl-math.cxx58
1 files changed, 29 insertions, 29 deletions
diff --git a/sal/qa/rtl/math/test-rtl-math.cxx b/sal/qa/rtl/math/test-rtl-math.cxx
index ee4ae55a1a4b..69a54bd814ef 100644
--- a/sal/qa/rtl/math/test-rtl-math.cxx
+++ b/sal/qa/rtl/math/test-rtl-math.cxx
@@ -505,84 +505,84 @@ public:
void test_erf() {
double x, res;
x = 0.0;
- res = rtl::math::erf(x);
+ res = std::erf(x);
CPPUNIT_ASSERT_EQUAL(0.0,res);
rtl::math::setInf( &x, false);
- res = rtl::math::erf(x);
+ res = std::erf(x);
CPPUNIT_ASSERT_EQUAL(1.0,res);
rtl::math::setInf( &x, true);
- res = rtl::math::erf(x);
+ res = std::erf(x);
CPPUNIT_ASSERT_EQUAL(-1.0,res);
rtl::math::setNan( &x);
- res = rtl::math::erf(x);
+ res = std::erf(x);
CPPUNIT_ASSERT(std::isnan(res));
x = 3.0;
- res = rtl::math::erf(-x);
- CPPUNIT_ASSERT_DOUBLES_EQUAL( -rtl::math::erf(x), res, 1E-12);
+ res = std::erf(-x);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL( -std::erf(x), res, 1E-12);
}
void test_erfc() {
double x, res;
x = 0.0;
- res = rtl::math::erfc(x);
+ res = std::erfc(x);
CPPUNIT_ASSERT_EQUAL(1.0,res);
rtl::math::setInf( &x, false);
- res = rtl::math::erfc(x);
+ res = std::erfc(x);
CPPUNIT_ASSERT_EQUAL(0.0,res);
rtl::math::setInf( &x, true);
- res = rtl::math::erfc(x);
+ res = std::erfc(x);
CPPUNIT_ASSERT_EQUAL(2.0,res);
rtl::math::setNan( &x);
- res = rtl::math::erfc(x);
+ res = std::erfc(x);
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);
+ res = std::erfc(-x);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL( 2.0 - std::erfc(x), res, 1E-12);
}
void test_expm1() {
double x, res;
x = 0.0;
- res = rtl::math::expm1(x);
+ res = std::expm1(x);
CPPUNIT_ASSERT_EQUAL(0.0,res);
x = -0.0;
- res = rtl::math::expm1(x);
+ res = std::expm1(x);
CPPUNIT_ASSERT_EQUAL(-0.0,res);
CPPUNIT_ASSERT(std::signbit(res));
rtl::math::setInf( &x, false);
- res = rtl::math::expm1(x);
+ res = std::expm1(x);
CPPUNIT_ASSERT_EQUAL(true, std::isinf(res) && !std::signbit(res));
rtl::math::setInf( &x, true);
- res = rtl::math::expm1(x);
+ res = std::expm1(x);
CPPUNIT_ASSERT_EQUAL(-1.0,res);
rtl::math::setNan( &x);
- res = rtl::math::expm1(x);
+ res = std::expm1(x);
CPPUNIT_ASSERT(std::isnan(res));
}
void test_log1p() {
double x, res;
x = 0.0;
- res = rtl::math::log1p(x);
+ res = std::log1p(x);
CPPUNIT_ASSERT_EQUAL(0.0,res);
x = -0.0;
- res = rtl::math::log1p(x);
+ res = std::log1p(x);
CPPUNIT_ASSERT_EQUAL(-0.0,res);
CPPUNIT_ASSERT(std::signbit(res));
rtl::math::setInf( &x, false);
- res = rtl::math::log1p(x);
+ res = std::log1p(x);
CPPUNIT_ASSERT_EQUAL(true, std::isinf(res) && !std::signbit(res));
x = -1.0;
- res = rtl::math::log1p(x);
+ res = std::log1p(x);
CPPUNIT_ASSERT_EQUAL(true, std::isinf(res) && std::signbit(res));
x = -1.1;
- res = rtl::math::log1p(x);
+ res = std::log1p(x);
CPPUNIT_ASSERT(std::isnan(res));
rtl::math::setInf( &x, true);
- res = rtl::math::log1p(x);
+ res = std::log1p(x);
CPPUNIT_ASSERT(std::isnan(res));
rtl::math::setNan( &x);
- res = rtl::math::log1p(x);
+ res = std::log1p(x);
CPPUNIT_ASSERT(std::isnan(res));
}
@@ -636,20 +636,20 @@ public:
void test_atanh() {
double res;
- res = rtl::math::atanh(-2.0); // NaN
+ res = std::atanh(-2.0); // NaN
CPPUNIT_ASSERT(std::isnan(res));
- res = rtl::math::atanh(-1.0); // -Inf
+ res = std::atanh(-1.0); // -Inf
CPPUNIT_ASSERT(std::signbit(res));
CPPUNIT_ASSERT(std::isinf(res));
- CPPUNIT_ASSERT_EQUAL(0.0, rtl::math::atanh(0.0));
+ CPPUNIT_ASSERT_EQUAL(0.0, std::atanh(0.0));
- res = rtl::math::atanh(1.0); // +Inf
+ res = std::atanh(1.0); // +Inf
CPPUNIT_ASSERT(!std::signbit(res));
CPPUNIT_ASSERT(std::isinf(res));
- res = rtl::math::atanh(2.0); // NaN
+ res = std::atanh(2.0); // NaN
CPPUNIT_ASSERT(std::isnan(res));
}