Zserio C++ runtime library  1.0.1
Built for Zserio 2.14.0
BuiltInOperators.cpp
Go to the documentation of this file.
2 
3 namespace zserio
4 {
5 
6 namespace builtin
7 {
8 
9 uint8_t numBits(uint64_t numValues)
10 {
11  if (numValues == 0)
12  return 0;
13 
14  uint8_t result = 1;
15  uint64_t current = (numValues - 1U) >> 1U;
16  while (current > 0)
17  {
18  result++;
19  current >>= 1U;
20  }
21 
22  return result;
23 }
24 
25 } // namespace builtin
26 
27 } // namespace zserio
uint8_t numBits(uint64_t numValues)