MCPcopy Create free account
hub / github.com/CodingGay/BlackDex / MinimumBitsToStore

Function MinimumBitsToStore

Bcore/src/main/cpp/base/bit_utils.h:123–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121// How many bits (minimally) does it take to store the constant 'value'? i.e. 1 for 1, 3 for 5, etc.
122template <typename T>
123constexpr size_t MinimumBitsToStore(T value) {
124 return static_cast<size_t>(MostSignificantBit(value) + 1);
125}
126
127template <typename T>
128constexpr T RoundUpToPowerOfTwo(T x) {

Callers

nothing calls this directly

Calls 1

MostSignificantBitFunction · 0.85

Tested by

no test coverage detected