Skip to content

Commit

Permalink
Fix value being checked for non-finite
Browse files Browse the repository at this point in the history
  • Loading branch information
mborland committed Jul 16, 2024
1 parent 9741663 commit f460701
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/boost/decimal/decimal32.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1169,15 +1169,15 @@ constexpr auto operator<=(decimal32 lhs, Integer rhs) noexcept
BOOST_DECIMAL_REQUIRES_RETURN(detail::is_integral_v, Integer, bool)
{
#ifndef BOOST_DECIMAL_FAST_MATH
if (!isfinite(rhs))
if (!isfinite(lhs))
{
if (isnan(rhs))
if (isnan(lhs))
{
return false;
}
else if (isinf(rhs))
else if (isinf(lhs))
{
return signbit(rhs);
return signbit(lhs);
}
}
#endif
Expand Down

0 comments on commit f460701

Please sign in to comment.