Skip to content

Commit 1116018

Browse files
committed
Promote the comparison type instead of using the decimal sig type
1 parent 0c9411f commit 1116018

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/boost/decimal/detail/comparison.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ template <BOOST_DECIMAL_DECIMAL_FLOATING_TYPE DecimalType = decimal32, BOOST_DEC
9696
constexpr auto equal_parts_impl(T1 lhs_sig, U1 lhs_exp, bool lhs_sign,
9797
T2 rhs_sig, U2 rhs_exp, bool rhs_sign) noexcept -> std::enable_if_t<std::is_same<DecimalType, decimal32>::value || std::is_same<DecimalType, decimal64>::value || std::is_same<DecimalType, decimal128>::value, bool>
9898
{
99-
using comp_type = typename DecimalType::significand_type;
99+
using comp_type = std::conditional_t<(std::numeric_limits<T1>::digits10 > std::numeric_limits<T2>::digits10), T1, T2>;
100100

101101
BOOST_DECIMAL_ASSERT(lhs_sig >= 0);
102102
BOOST_DECIMAL_ASSERT(rhs_sig >= 0);

0 commit comments

Comments
 (0)