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 2c141fe
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
18 changes: 15 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,11 @@ 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 +153,11 @@ 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 +201,11 @@ 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
18 changes: 15 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,11 @@ 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 +124,11 @@ 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 +171,11 @@ 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 2c141fe

Please sign in to comment.