]>
Commit | Line | Data |
---|---|---|
1e59de90 TL |
1 | // Copyright Matt Borland, 2022 |
2 | // Use, modification and distribution are subject to the | |
3 | // Boost Software License, Version 1.0. (See accompanying file | |
4 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
5 | ||
6 | #include "math_unit_test.hpp" | |
7 | #include <cmath> | |
8 | #include <boost/math/special_functions/powm1.hpp> | |
9 | ||
10 | template <typename T> | |
11 | void test() | |
12 | { | |
13 | CHECK_EQUAL(std::pow(T(0), T(2)) - 1, boost::math::powm1(T(0), T(2))); | |
14 | CHECK_EQUAL(std::pow(T(0), T(-2)) - 1, boost::math::powm1(T(0), T(-2))); | |
15 | CHECK_EQUAL(std::pow(T(0), T(0.1)) - 1, boost::math::powm1(T(0), T(0.1))); | |
16 | CHECK_EQUAL(std::pow(T(0), T(-0.1)) - 1, boost::math::powm1(T(0), T(-0.1))); | |
17 | } | |
18 | ||
19 | int main() | |
20 | { | |
21 | test<float>(); | |
22 | test<double>(); | |
23 | ||
24 | #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS | |
25 | test<long double>(); | |
26 | #endif | |
27 | ||
28 | return boost::math::test::report_errors(); | |
29 | } |