Zserio C++ runtime library
1.1.0
Built for Zserio 2.15.0
BuiltInOperators.cpp
Go to the documentation of this file.
1
#include "
zserio/BuiltInOperators.h
"
2
3
namespace
zserio
4
{
5
6
namespace
builtin
7
{
8
9
uint8_t
numBits
(uint64_t numValues)
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
BuiltInOperators.h
zserio::builtin::numBits
uint8_t numBits(uint64_t numValues)
Definition:
BuiltInOperators.cpp:9
zserio
Definition:
AllocatorHolder.h:7
zserio
BuiltInOperators.cpp
Generated by
1.9.1