MCPcopy Create free account
hub / github.com/brainboxdotcc/DPP / log2

Function log2

mlspp/src/tree_math.cpp:8–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6static const uint32_t one = 0x01;
7
8static uint32_t
9log2(uint32_t x)
10{
11 if (x == 0) {
12 return 0;
13 }
14
15 uint32_t k = 0;
16 while ((x >> k) > 0) {
17 k += 1;
18 }
19 return k - 1;
20}
21
22namespace mlspp {
23

Callers 1

rootMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected