]>
Commit | Line | Data |
---|---|---|
1e59de90 TL |
1 | // (C) 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 <cmath> | |
7 | #include <cfloat> | |
8 | #include <cstdint> | |
9 | #include <limits> | |
10 | #include <type_traits> | |
11 | #include <boost/math/ccmath/isless.hpp> | |
12 | #include <boost/math/ccmath/isnan.hpp> | |
13 | #include <boost/math/ccmath/isinf.hpp> | |
14 | ||
15 | #ifdef BOOST_HAS_FLOAT128 | |
16 | #include <boost/multiprecision/float128.hpp> | |
17 | #endif | |
18 | ||
19 | template <typename T> | |
20 | constexpr void test() | |
21 | { | |
22 | static_assert(!boost::math::ccmath::isless(std::numeric_limits<T>::quiet_NaN(), T(1))); | |
23 | static_assert(!boost::math::ccmath::isless(T(1), std::numeric_limits<T>::quiet_NaN())); | |
24 | static_assert(!boost::math::ccmath::isless(std::numeric_limits<T>::quiet_NaN(), std::numeric_limits<T>::quiet_NaN())); | |
25 | ||
26 | static_assert(!boost::math::ccmath::isless(T(2), T(1))); | |
27 | static_assert(!boost::math::ccmath::isless(T(2), T(2))); | |
28 | static_assert(boost::math::ccmath::isless(T(1), T(2))); | |
29 | } | |
30 | ||
31 | #if !defined(BOOST_MATH_NO_CONSTEXPR_DETECTION) && !defined(BOOST_MATH_USING_BUILTIN_CONSTANT_P) | |
32 | int main() | |
33 | { | |
34 | test<float>(); | |
35 | test<double>(); | |
36 | ||
37 | #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS | |
38 | test<long double>(); | |
39 | #endif | |
40 | ||
41 | #ifdef BOOST_HAS_FLOAT128 | |
42 | test<boost::multiprecision::float128>(); | |
43 | #endif | |
44 | ||
45 | return 0; | |
46 | } | |
47 | #else | |
48 | int main() | |
49 | { | |
50 | return 0; | |
51 | } | |
52 | #endif |