]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/math/test/ccmath_fmax_test.cpp
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)
10 #include <type_traits>
11 #include <boost/math/ccmath/fmax.hpp>
12 #include <boost/math/ccmath/isnan.hpp>
13 #include <boost/math/ccmath/isinf.hpp>
15 #ifdef BOOST_HAS_FLOAT128
16 #include <boost/multiprecision/float128.hpp>
22 static_assert(boost::math::ccmath::fmax(T(2), T(1)) == T(2));
23 static_assert(boost::math::ccmath::fmax(T(1), T(2)) == T(2));
24 static_assert(boost::math::ccmath::fmax(T(2), T(2)) == T(2));
26 static_assert(boost::math::ccmath::fmax(std::numeric_limits
<T
>::quiet_NaN(), T(-1)) == T(-1));
27 static_assert(boost::math::ccmath::fmax(T(-1), std::numeric_limits
<T
>::quiet_NaN()) == T(-1));
29 static_assert(boost::math::ccmath::fmax(std::numeric_limits
<T
>::infinity(), T(3)) == std::numeric_limits
<T
>::infinity());
30 static_assert(boost::math::ccmath::fmax(-std::numeric_limits
<T
>::infinity(), T(3)) == T(3));
33 #if !defined(BOOST_MATH_NO_CONSTEXPR_DETECTION) && !defined(BOOST_MATH_USING_BUILTIN_CONSTANT_P)
39 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
43 #ifdef BOOST_HAS_FLOAT128
44 test
<boost::multiprecision::float128
>();