File indexing completed on 2025-01-30 09:45:15
0001
0002
0003
0004
0005
0006 #ifndef BOOST_MATH_CCMATH_ISLESSEQUAL_HPP
0007 #define BOOST_MATH_CCMATH_ISLESSEQUAL_HPP
0008
0009 #include <boost/math/ccmath/detail/config.hpp>
0010
0011 #ifdef BOOST_MATH_NO_CCMATH
0012 #error "The header <boost/math/islessequal.hpp> can only be used in C++17 and later."
0013 #endif
0014
0015 #include <boost/math/ccmath/isnan.hpp>
0016
0017 namespace boost::math::ccmath {
0018
0019 template <typename T1, typename T2 = T1>
0020 inline constexpr bool islessequal(T1 x, T2 y) noexcept
0021 {
0022 if (BOOST_MATH_IS_CONSTANT_EVALUATED(x))
0023 {
0024 if (boost::math::ccmath::isnan(x) || boost::math::ccmath::isnan(y))
0025 {
0026 return false;
0027 }
0028 else
0029 {
0030 return x <= y;
0031 }
0032 }
0033 else
0034 {
0035 using std::islessequal;
0036 return islessequal(x, y);
0037 }
0038 }
0039
0040 }
0041
0042 #endif