Skip to content

Commit 2bdb167

Browse files
committed
Simplify locally used types in log10 impl
1 parent fa81b3c commit 2bdb167

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

include/boost/decimal/detail/cmath/log10.hpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,15 @@ constexpr auto log10_impl(T x) noexcept
5050
{
5151
int exp10val { };
5252

53-
using representation_type = std::conditional_t<std::is_same<T, decimal32>::value, std::uint32_t,
54-
std::conditional_t<std::is_same<T, decimal64>::value, std::uint64_t, detail::uint128>>;
53+
const auto gn { frexp10(x, &exp10val) };
5554

56-
const representation_type gn { frexp10(x, &exp10val) };
57-
58-
const remove_trailing_zeros_return<representation_type>
55+
const auto
5956
zeros_removal
6057
{
6158
remove_trailing_zeros(gn)
6259
};
6360

64-
const bool is_pure
65-
{
66-
(zeros_removal.trimmed_number == static_cast<representation_type>(UINT8_C(1)))
67-
};
61+
const bool is_pure { static_cast<unsigned>(zeros_removal.trimmed_number) == 1U };
6862

6963
if(is_pure)
7064
{

0 commit comments

Comments
 (0)