summaryrefslogtreecommitdiff
path: root/include/mbgl/math/log2.hpp
blob: 6a1ba23ed940e8d9651c677f662c35d9df2e1d7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#pragma once

#include <cmath>
#include <cstdint>

namespace mbgl {
namespace util {

// Computes the log2(x) rounded up to the next integer.
// (== number of bits required to store x)
uint32_t ceil_log2(uint64_t x);

} // namespace util
} // namespace mbgl