We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e50c56e commit a2ca370Copy full SHA for a2ca370
include/boost/decimal/detail/to_integral.hpp
@@ -51,8 +51,9 @@ constexpr auto to_integral(Decimal val) noexcept
51
52
auto result {static_cast<Conversion_Type>(val.full_significand())};
53
auto expval {val.biased_exponent()};
54
+ const auto abs_exp_val {detail::make_positive_unsigned(expval)};
55
- if (std::abs(expval) >= 19)
56
+ if (abs_exp_val >= 19)
57
{
58
result = 0;
59
}
@@ -93,8 +94,9 @@ constexpr auto to_integral_128(Decimal val) noexcept
93
94
95
auto sig {val.full_significand()};
96
97
98
- if (std::abs(expval) >= 38)
99
+ if (abs_exp_val >= 38)
100
101
sig = 0;
102
0 commit comments