20namespace seqan3::detail
50template <std::
unsigned_
integral
unsigned_t>
51constexpr unsigned_t floor_log2(unsigned_t
const n)
noexcept
84template <std::
unsigned_
integral
unsigned_t>
85constexpr unsigned_t ceil_log2(unsigned_t
const n)
noexcept
88 return (n == 1u) ? 0u : seqan3::detail::floor_log2(n - 1u) + 1u;
117template <
typename base_t, std::
unsigned_
integral exp_t>
118 requires (std::same_as<base_t, uint64_t> || std::same_as<base_t, int64_t>)
131 +
" will result in an "
132 + (std::same_as<base_t, int64_t> ?
"int64_t" :
"uint64_t")};
141 for (; exp; exp >>= 1, base *= base)
142 result *= (exp & 1) ? base : 1;
149template <std::
integral base_t, std::
unsigned_
integral exp_t>
150 requires (std::unsigned_integral<base_t> && !std::same_as<base_t, uint64_t>)
151uint64_t
pow(base_t base, exp_t exp)
153 return pow(
static_cast<uint64_t
>(base), exp);
157template <std::
integral base_t, std::
unsigned_
integral exp_t>
158 requires (!std::unsigned_integral<base_t> && !std::same_as<base_t, int64_t>)
159int64_t
pow(base_t base, exp_t exp)
161 return pow(
static_cast<int64_t
>(base), exp);
165template <
typename base_t,
typename exp_t>
166 requires (!(std::integral<base_t> && std::unsigned_integral<exp_t>))
167auto pow(base_t base, exp_t exp)
A "pretty printer" for most SeqAn data structures and related types.
Definition debug_stream_type.hpp:79
base_t pow(base_t base, exp_t exp)
Computes the value of base raised to the power exp.
Definition math.hpp:119
The main SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26