2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-19 16:32:10 +00:00

Fix ADL failures for __float128

This commit is contained in:
Matt Borland
2023-11-17 08:20:05 +01:00
parent 2cb550d65e
commit 6c5fd09a40
2 changed files with 10 additions and 6 deletions

View File

@@ -38,17 +38,19 @@ constexpr void test()
static_assert(boost::math::ccmath::ceil(T(-2.7)) == T(-2));
static_assert(boost::math::ccmath::ceil(T(-2)) == T(-2));
using std::ceil;
constexpr T half_max_ceil = boost::math::ccmath::ceil(T((std::numeric_limits<T>::max)() / 2));
static_assert(half_max_ceil == (std::numeric_limits<T>::max)() / 2);
BOOST_MATH_ASSERT(half_max_ceil == std::ceil((std::numeric_limits<T>::max)() / 2));
BOOST_MATH_ASSERT(half_max_ceil == ceil((std::numeric_limits<T>::max)() / 2));
constexpr T third_max_ceil = boost::math::ccmath::ceil(T((std::numeric_limits<T>::max)() / 3));
static_assert(third_max_ceil == (std::numeric_limits<T>::max)() / 3);
BOOST_MATH_ASSERT(third_max_ceil == std::ceil((std::numeric_limits<T>::max)() / 3));
BOOST_MATH_ASSERT(third_max_ceil == ceil((std::numeric_limits<T>::max)() / 3));
constexpr T one_over_eps = boost::math::ccmath::ceil(1 / T(std::numeric_limits<T>::epsilon()));
static_assert(one_over_eps == 1 / T(std::numeric_limits<T>::epsilon()));
BOOST_MATH_ASSERT(one_over_eps == std::ceil(1 / T(std::numeric_limits<T>::epsilon())));
BOOST_MATH_ASSERT(one_over_eps == ceil(1 / T(std::numeric_limits<T>::epsilon())));
}
#if !defined(BOOST_MATH_NO_CONSTEXPR_DETECTION) && !defined(BOOST_MATH_USING_BUILTIN_CONSTANT_P)

View File

@@ -38,17 +38,19 @@ constexpr void test()
static_assert(boost::math::ccmath::floor(T(-2.7)) == T(-3));
static_assert(boost::math::ccmath::floor(T(-2)) == T(-2));
using std::floor;
constexpr T half_max_floor = boost::math::ccmath::floor(T((std::numeric_limits<T>::max)() / 2));
static_assert(half_max_floor == (std::numeric_limits<T>::max)() / 2);
BOOST_MATH_ASSERT(half_max_floor == std::floor((std::numeric_limits<T>::max)() / 2));
BOOST_MATH_ASSERT(half_max_floor == floor((std::numeric_limits<T>::max)() / 2));
constexpr T third_max_floor = boost::math::ccmath::floor(T((std::numeric_limits<T>::max)() / 3));
static_assert(third_max_floor == (std::numeric_limits<T>::max)() / 3);
BOOST_MATH_ASSERT(third_max_floor == std::floor((std::numeric_limits<T>::max)() / 3));
BOOST_MATH_ASSERT(third_max_floor == floor((std::numeric_limits<T>::max)() / 3));
constexpr T one_over_eps = boost::math::ccmath::floor(1 / T(std::numeric_limits<T>::epsilon()));
static_assert(one_over_eps == 1 / T(std::numeric_limits<T>::epsilon()));
BOOST_MATH_ASSERT(one_over_eps == std::floor(1 / T(std::numeric_limits<T>::epsilon())));
BOOST_MATH_ASSERT(one_over_eps == floor(1 / T(std::numeric_limits<T>::epsilon())));
}
#if !defined(BOOST_MATH_NO_CONSTEXPR_DETECTION) && !defined(BOOST_MATH_USING_BUILTIN_CONSTANT_P)