File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
include/boost/decimal/detail Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ // Copyright 2025 Matt Borland
2+ // Distributed under the Boost Software License, Version 1.0.
3+ // https://www.boost.org/LICENSE_1_0.txt
4+
5+ #ifndef BOOST_DECIMAL_DETAIL_IS_POWER_OF_10_HPP
6+ #define BOOST_DECIMAL_DETAIL_IS_POWER_OF_10_HPP
7+
8+ #include < boost/decimal/detail/config.hpp>
9+ #include < boost/decimal/detail/remove_trailing_zeros.hpp>
10+ #include < boost/decimal/detail/concepts.hpp>
11+
12+ namespace boost {
13+ namespace decimal {
14+ namespace detail {
15+
16+ template <typename T>
17+ constexpr auto is_power_of_10 (const T x) noexcept
18+ BOOST_DECIMAL_REQUIRES_RETURN(detail::is_unsigned_v, T, bool )
19+ {
20+ const auto removed_zeros {detail::remove_trailing_zeros (x)};
21+ return removed_zeros.trimmed_number == 1U ;
22+ }
23+
24+ } // namespace detail
25+ } // namespace decimal
26+ } // namespace boost
27+
28+ #endif // BOOST_DECIMAL_DETAIL_IS_POWER_OF_10_HPP
You can’t perform that action at this time.
0 commit comments