Skip to content

Commit 51d4bad

Browse files
committed
Simplify mixed operator-
1 parent 263ac1e commit 51d4bad

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

include/boost/decimal/decimal128_fast.hpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -900,10 +900,7 @@ constexpr auto operator-(decimal128_fast lhs, Integer rhs) noexcept
900900

901901
const bool abs_lhs_bigger {abs(lhs) > detail::make_positive_unsigned(rhs)};
902902

903-
auto sig_lhs {lhs.full_significand()};
904-
auto exp_lhs {lhs.biased_exponent()};
905-
detail::normalize<decimal128>(sig_lhs, exp_lhs);
906-
auto lhs_components {detail::decimal128_fast_components{sig_lhs, exp_lhs, lhs.isneg()}};
903+
auto lhs_components {detail::decimal128_fast_components{lhs.significand_, lhs.biased_exponent(), lhs.isneg()}};
907904

908905
auto sig_rhs {static_cast<detail::uint128>(detail::make_positive_unsigned(rhs))};
909906
std::int32_t exp_rhs {0};
@@ -943,10 +940,7 @@ constexpr auto operator-(Integer lhs, decimal128_fast rhs) noexcept
943940
auto unsigned_sig_lhs {detail::make_positive_unsigned(sig_lhs)};
944941
auto lhs_components {detail::decimal128_fast_components{unsigned_sig_lhs, exp_lhs, (lhs < 0)}};
945942

946-
auto sig_rhs {rhs.full_significand()};
947-
auto exp_rhs {rhs.biased_exponent()};
948-
detail::normalize<decimal128>(sig_rhs, exp_rhs);
949-
auto rhs_components {detail::decimal128_fast_components{sig_rhs, exp_rhs, rhs.isneg()}};
943+
auto rhs_components {detail::decimal128_fast_components{rhs.significand_, rhs.biased_exponent(), rhs.isneg()}};
950944

951945
const auto result {detail::d128_sub_impl<detail::decimal128_fast_components>(
952946
lhs_components.sig, lhs_components.exp, lhs_components.sign,

0 commit comments

Comments
 (0)