Skip to content

Commit 06b06c1

Browse files
committed
Simplify mixed operator/
1 parent 4856707 commit 06b06c1

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

include/boost/decimal/decimal128_fast.hpp

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,7 @@ constexpr auto d128f_div_impl(decimal128_fast lhs, decimal128_fast rhs, decimal1
10721072
#else
10731073
static_cast<void>(r);
10741074
#endif
1075-
1075+
10761076
#ifdef BOOST_DECIMAL_DEBUG
10771077
std::cerr << "sig lhs: " << sig_lhs
10781078
<< "\nexp lhs: " << exp_lhs
@@ -1138,11 +1138,7 @@ constexpr auto operator/(decimal128_fast lhs, Integer rhs) noexcept
11381138
}
11391139
#endif
11401140

1141-
auto lhs_sig {lhs.full_significand()};
1142-
auto lhs_exp {lhs.biased_exponent()};
1143-
detail::normalize<decimal128>(lhs_sig, lhs_exp);
1144-
1145-
detail::decimal128_fast_components lhs_components {lhs_sig, lhs_exp, lhs.isneg()};
1141+
detail::decimal128_fast_components lhs_components {lhs.significand_, lhs.biased_exponent(), lhs.isneg()};
11461142

11471143
auto rhs_sig {detail::make_positive_unsigned(rhs)};
11481144
std::int32_t rhs_exp {};
@@ -1184,12 +1180,8 @@ constexpr auto operator/(Integer lhs, decimal128_fast rhs) noexcept
11841180
}
11851181
#endif
11861182

1187-
auto rhs_sig {rhs.full_significand()};
1188-
auto rhs_exp {rhs.biased_exponent()};
1189-
detail::normalize<decimal128>(rhs_sig, rhs_exp);
1190-
11911183
detail::decimal128_fast_components lhs_components {detail::make_positive_unsigned(lhs), 0, lhs < 0};
1192-
detail::decimal128_fast_components rhs_components {rhs_sig, rhs_exp, rhs.isneg()};
1184+
detail::decimal128_fast_components rhs_components {rhs.significand_, rhs.biased_exponent(), rhs.isneg()};
11931185
detail::decimal128_fast_components q_components {};
11941186

11951187
detail::d128_generic_div_impl(lhs_components, rhs_components, q_components);

0 commit comments

Comments
 (0)