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 (#1218)

fixes #1217
  • Loading branch information
pps83 authored Oct 28, 2024
1 parent 097b73c commit 2cd9c4d
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)
{
#if defined(__clang_major__) && __clang_major__ >= 6
#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();
#if defined(__clang_major__) && __clang_major__ >= 6
#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 2cd9c4d

Please sign in to comment.