Skip to content

Commit

Permalink
Avoid decimal to decimal double checking of non-finite values
Browse files Browse the repository at this point in the history
  • Loading branch information
mborland committed Jul 16, 2024
1 parent f460701 commit e727f04
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions include/boost/decimal/decimal32.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,8 @@ constexpr auto operator<=(decimal32 lhs, decimal32 rhs) noexcept -> bool
}
#endif

return !(rhs < lhs);
return !less_parts_impl(rhs.full_significand(), rhs.biased_exponent(), rhs.isneg(),
lhs.full_significand(), lhs.biased_exponent(), lhs.isneg());
}

template <typename Integer>
Expand Down Expand Up @@ -1267,7 +1268,8 @@ constexpr auto operator>=(decimal32 lhs, decimal32 rhs) noexcept -> bool
}
#endif

return !(lhs < rhs);
return !less_parts_impl(lhs.full_significand(), lhs.biased_exponent(), lhs.isneg(),
rhs.full_significand(), rhs.biased_exponent(), rhs.isneg());
}

template <typename Integer>
Expand Down

0 comments on commit e727f04

Please sign in to comment.