From e727f04bbe65cda05d280603db07944e721622db Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Tue, 16 Jul 2024 11:21:00 -0400 Subject: [PATCH] Avoid decimal to decimal double checking of non-finite values --- include/boost/decimal/decimal32.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/boost/decimal/decimal32.hpp b/include/boost/decimal/decimal32.hpp index 9ebc3bba8..4c8e0e6fc 100644 --- a/include/boost/decimal/decimal32.hpp +++ b/include/boost/decimal/decimal32.hpp @@ -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 @@ -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