Return floor(log2(n)) for positive integer n. Returns -1 iff n == 0.
| 37 | |
| 38 | // Return floor(log2(n)) for positive integer n. Returns -1 iff n == 0. |
| 39 | inline int Log2Floor(uint32 n) { return n == 0 ? -1 : 31 ^ __builtin_clz(n); } |
| 40 | |
| 41 | // Return floor(log2(n)) for positive integer n. Returns -1 iff n == 0. |
| 42 | inline int Log2Floor64(uint64 n) { |
no outgoing calls
no test coverage detected