Skip to content

Commit 35ada3d

Browse files
committed
Fix calculation of resultant digits
1 parent e5cd086 commit 35ada3d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/boost/decimal/detail/mul_impl.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ constexpr auto d128_mul_impl(T1 lhs_sig, U1 lhs_exp, bool lhs_sign,
125125
const auto rhs_dig {detail::num_digits(rhs_sig)};
126126

127127
// If we can avoid it don't do 256 bit multiplication because it is slow
128-
if (lhs_dig * rhs_dig <= std::numeric_limits<uint128>::digits10)
128+
if (lhs_dig + rhs_dig <= std::numeric_limits<uint128>::digits10)
129129
{
130130
auto res_sig {lhs_sig * rhs_sig};
131131
auto res_exp {lhs_exp + rhs_exp};

0 commit comments

Comments
 (0)