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