Skip to content

Commit

Permalink
Disable __float128
Browse files Browse the repository at this point in the history
  • Loading branch information
mborland committed Apr 3, 2023
1 parent 03f4498 commit ef073ef
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
15 changes: 12 additions & 3 deletions include/boost/math/special_functions/round.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ inline int iround(const T& v, const Policy& pol)
result_type r = boost::math::round(v, pol);

#ifdef BOOST_MATH_HAS_CONSTEXPR_LDEXP
if constexpr (std::is_arithmetic_v<result_type>)
if constexpr (std::is_arithmetic_v<result_type> &&
#ifdef BOOST_MATH_FLOAT128_TYPE
!std::is_same_v<BOOST_MATH_FLOAT128_TYPE, result_type>
#endif)
{
constexpr result_type max_val = boost::math::ccmath::ldexp(static_cast<result_type>(1), std::numeric_limits<int>::digits);

Expand Down Expand Up @@ -149,7 +152,10 @@ inline long lround(const T& v, const Policy& pol)
result_type r = boost::math::round(v, pol);

#ifdef BOOST_MATH_HAS_CONSTEXPR_LDEXP
if constexpr (std::is_arithmetic_v<result_type>)
if constexpr (std::is_arithmetic_v<result_type> &&
#ifdef BOOST_MATH_FLOAT128_TYPE
!std::is_same_v<BOOST_MATH_FLOAT128_TYPE, result_type>
#endif)
{
constexpr result_type max_val = boost::math::ccmath::ldexp(static_cast<result_type>(1), std::numeric_limits<long>::digits);

Expand Down Expand Up @@ -193,7 +199,10 @@ inline long long llround(const T& v, const Policy& pol)
result_type r = boost::math::round(v, pol);

#ifdef BOOST_MATH_HAS_CONSTEXPR_LDEXP
if constexpr (std::is_arithmetic_v<result_type>)
if constexpr (std::is_arithmetic_v<result_type> &&
#ifdef BOOST_MATH_FLOAT128_TYPE
!std::is_same_v<BOOST_MATH_FLOAT128_TYPE, result_type>
#endif)
{
constexpr result_type max_val = boost::math::ccmath::ldexp(static_cast<result_type>(1), std::numeric_limits<long long>::digits);

Expand Down
15 changes: 12 additions & 3 deletions include/boost/math/special_functions/trunc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ inline int itrunc(const T& v, const Policy& pol)
result_type r = boost::math::trunc(v, pol);

#ifdef BOOST_MATH_HAS_CONSTEXPR_LDEXP
if constexpr (std::is_arithmetic_v<result_type>)
if constexpr (std::is_arithmetic_v<result_type> &&
#ifdef BOOST_MATH_FLOAT128_TYPE
!std::is_same_v<BOOST_MATH_FLOAT128_TYPE, result_type>
#endif)
{
constexpr result_type max_val = boost::math::ccmath::ldexp(static_cast<result_type>(1), std::numeric_limits<int>::digits);

Expand Down Expand Up @@ -120,7 +123,10 @@ inline long ltrunc(const T& v, const Policy& pol)
result_type r = boost::math::trunc(v, pol);

#ifdef BOOST_MATH_HAS_CONSTEXPR_LDEXP
if constexpr (std::is_arithmetic_v<result_type>)
if constexpr (std::is_arithmetic_v<result_type> &&
#ifdef BOOST_MATH_FLOAT128_TYPE
!std::is_same_v<BOOST_MATH_FLOAT128_TYPE, result_type>
#endif)
{
constexpr result_type max_val = boost::math::ccmath::ldexp(static_cast<result_type>(1), std::numeric_limits<long>::digits);

Expand Down Expand Up @@ -163,7 +169,10 @@ inline long long lltrunc(const T& v, const Policy& pol)
result_type r = boost::math::trunc(v, pol);

#ifdef BOOST_MATH_HAS_CONSTEXPR_LDEXP
if constexpr (std::is_arithmetic_v<result_type>)
if constexpr (std::is_arithmetic_v<result_type> &&
#ifdef BOOST_MATH_FLOAT128_TYPE
!std::is_same_v<BOOST_MATH_FLOAT128_TYPE, result_type>
#endif)
{
constexpr result_type max_val = boost::math::ccmath::ldexp(static_cast<result_type>(1), std::numeric_limits<long long>::digits);

Expand Down

0 comments on commit ef073ef

Please sign in to comment.