File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed
include/boost/decimal/detail/cmath Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -44,23 +44,14 @@ constexpr auto nextafter_impl(const DecimalType val, const bool direction) noexc
4444 return min_val;
4545 }
4646
47- const auto components {val.to_components ()};
48- auto sig {components.sig };
49- auto exp {components.exp };
50- const auto removed_zeros {remove_trailing_zeros (sig)};
51- const auto sig_dig {num_digits (sig)};
47+ int exp {};
48+ auto sig {frexp10 (val, &exp)};
49+ const auto removed_zeros (remove_trailing_zeros (sig));
5250
5351 // Our two boundaries
5452 const bool is_pow_10 {removed_zeros.trimmed_number == 1U };
5553 const bool is_max_sig {sig == detail::max_significand_v<DecimalType>};
5654
57- if (sig_dig < detail::precision_v<DecimalType>)
58- {
59- const auto offset{detail::precision_v<DecimalType> - sig_dig};
60- sig *= pow10 (static_cast <decltype (sig)>(detail::precision_v<DecimalType> - sig_dig));
61- exp -= offset;
62- }
63-
6455 if (direction)
6556 {
6657 // Val < direction = +
You can’t perform that action at this time.
0 commit comments