MCPcopy
hub / github.com/cornelk/hashmap / log2

Function log2

util.go:26–32  ·  view source on GitHub ↗

log2 computes the binary logarithm of x, rounded up to the next integer.

(i uintptr)

Source from the content-addressed store, hash-verified

24
25// log2 computes the binary logarithm of x, rounded up to the next integer.
26func log2(i uintptr) uintptr {
27 var n, p uintptr
28 for p = 1; p < i; p += p {
29 n++
30 }
31 return n
32}

Callers 2

TestLog2Function · 0.85
growMethod · 0.85

Calls

no outgoing calls

Tested by 1

TestLog2Function · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…