Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
6
static const uint32_t one = 0x01;
7
8
static uint32_t
9
log2(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
22
namespace mlspp {
23
Callers
1
root
Method · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected