MCPcopy Create free account
hub / github.com/VectorDB-NTU/RaBitQ-Library / floor_log2

Function floor_log2

include/rabitqlib/utils/tools.hpp:44–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44constexpr size_t div_round_up(size_t val, size_t div) {
45 return (val / div) + static_cast<size_t>((val % div) != 0);
46}
47
48constexpr size_t round_up_to_multiple(size_t val, size_t multiple_of) {
49 return multiple_of * (div_round_up(val, multiple_of));
50}
51
52inline size_t floor_log2(size_t x) {
53 size_t ret = 0;
54 while (x > 1) {

Callers 2

FhtKacRotatorMethod · 0.85
ceil_log2Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected