]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/math/ccmath/isgreater.hpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / boost / math / ccmath / isgreater.hpp
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 #ifndef BOOST_MATH_CCMATH_ISGREATER_HPP
7 #define BOOST_MATH_CCMATH_ISGREATER_HPP
8
9 #include <cmath>
10 #include <limits>
11 #include <boost/math/tools/is_constant_evaluated.hpp>
12 #include <boost/math/ccmath/isnan.hpp>
13
14 namespace boost::math::ccmath {
15
16 template <typename T1, typename T2 = T1>
17 inline constexpr bool isgreater(T1 x, T2 y) noexcept
18 {
19 if (BOOST_MATH_IS_CONSTANT_EVALUATED(x))
20 {
21 if (boost::math::ccmath::isnan(x) || boost::math::ccmath::isnan(y))
22 {
23 return false;
24 }
25 else
26 {
27 return x > y;
28 }
29 }
30 else
31 {
32 using std::isgreater;
33 return isgreater(x, y);
34 }
35 }
36
37 } // Namespaces
38
39 #endif // BOOST_MATH_CCMATH_ISGREATER_HPP