Skip to content

Commit

Permalink
Add extra parentheses for concept tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mborland committed Mar 20, 2023
1 parent 5a50ec7 commit 93f011e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion include/boost/math/ccmath/abs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace detail {
template <typename T>
constexpr T abs_impl(T x) noexcept
{
if (boost::math::ccmath::isnan(x))
if ((boost::math::ccmath::isnan)(x))
{
return std::numeric_limits<T>::quiet_NaN();
}
Expand Down
6 changes: 3 additions & 3 deletions include/boost/math/ccmath/isinf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
namespace boost::math::ccmath {

template <typename T>
constexpr bool isinf(T x) noexcept
constexpr bool (isinf)(T x) noexcept
{
if(BOOST_MATH_IS_CONSTANT_EVALUATED(x))
{
Expand All @@ -41,11 +41,11 @@ constexpr bool isinf(T x) noexcept

if constexpr (!std::is_integral_v<T>)
{
return isinf(x);
return (isinf)(x);
}
else
{
return isinf(static_cast<double>(x));
return (isinf)(static_cast<double>(x));
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions include/boost/math/ccmath/isnan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
namespace boost::math::ccmath {

template <typename T>
inline constexpr bool isnan(T x)
inline constexpr bool (isnan)(T x)
{
if(BOOST_MATH_IS_CONSTANT_EVALUATED(x))
{
Expand All @@ -33,11 +33,11 @@ inline constexpr bool isnan(T x)

if constexpr (!std::is_integral_v<T>)
{
return isnan(x);
return (isnan)(x);
}
else
{
return isnan(static_cast<double>(x));
return (isnan)(static_cast<double>(x));
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions include/boost/math/ccmath/ldexp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ inline constexpr Real ldexp(Real arg, int exp) noexcept
if(BOOST_MATH_IS_CONSTANT_EVALUATED(arg))
{
return boost::math::ccmath::abs(arg) == Real(0) ? arg :
boost::math::ccmath::isinf(arg) ? arg :
boost::math::ccmath::isnan(arg) ? arg :
(boost::math::ccmath::isinf)(arg) ? arg :
(boost::math::ccmath::isnan)(arg) ? arg :
boost::math::ccmath::detail::ldexp_impl(arg, exp);
}
else
Expand Down

0 comments on commit 93f011e

Please sign in to comment.