Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:45:15

0001 //  (C) Copyright Matt Borland 2022.
0002 //  Use, modification and distribution are subject to the
0003 //  Boost Software License, Version 1.0. (See accompanying file
0004 //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0005 
0006 #ifndef BOOST_MATH_CCMATH_ISGREATER_HPP
0007 #define BOOST_MATH_CCMATH_ISGREATER_HPP
0008 
0009 #include <boost/math/ccmath/detail/config.hpp>
0010 
0011 #ifdef BOOST_MATH_NO_CCMATH
0012 #error "The header <boost/math/isgreater.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 isgreater(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::isgreater;
0036         return isgreater(x, y);
0037     }
0038 }
0039 
0040 } // Namespaces
0041 
0042 #endif // BOOST_MATH_CCMATH_ISGREATER_HPP