Skip to content

Commit

Permalink
Fix icx warning: explicit comparison with infinity in fast floating p…
Browse files Browse the repository at this point in the history
…oint mode with intel compiler

fixes boostorg#1217
  • Loading branch information
pps83 committed Oct 25, 2024
1 parent 097b73c commit 0f669be
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion include/boost/math/ccmath/isinf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,14 @@ constexpr bool isinf BOOST_MATH_PREVENT_MACRO_SUBSTITUTION(T x) noexcept
{
if constexpr (std::numeric_limits<T>::is_signed)
{
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wtautological-constant-compare"
#endif
return x == std::numeric_limits<T>::infinity() || -x == std::numeric_limits<T>::infinity();
#ifdef __clang__
#pragma clang diagnostic pop
#endif
}
else
{
Expand All @@ -32,7 +39,7 @@ constexpr bool isinf BOOST_MATH_PREVENT_MACRO_SUBSTITUTION(T x) noexcept
else
{
using boost::math::isinf;

if constexpr (!std::is_integral_v<T>)
{
return (isinf)(x);
Expand Down

0 comments on commit 0f669be

Please sign in to comment.