12 if (n >> 32) { r += 32U; n >>= 32U; }
13 if (n >> 16) { r += 16U; n >>= 16U; }
14 if (n >> 8) { r += 8U; n >>= 8U; }
15 if (n >> 4) { r += 4U; n >>= 4U; }
16 if (n >> 2) { r += 2U; n >>= 2U; }
17 if (n >> 1) { r += 1U; n >>= 1U; }
19 return r +
static_cast<uint32_t
>(n);
24 return bits_to_represent(
static_cast<uintmax_t
>(max) -
static_cast<uintmax_t
>(min));
constexpr uint32_t bits_in_range(intmax_t min, intmax_t max)
Definition: bits.h:22
constexpr uint32_t bits_to_represent(uintmax_t n)
Definition: bits.h:8