math/ceil_pow2.hpp
- View this file on GitHub
- Last update: 2020-09-14 19:36:00+09:00
- Include:
#include "math/ceil_pow2.hpp"
Required by
Verified with
graph_tree/test/LC_centroid_decomposition.test.cpp
math/test/LC_convolution_1000000007.test.cpp
math/test/LC_convolution_998244353.test.cpp
math/test/LC_interpolation.test.cpp
Code
int ceil_pow2(int n) {
int x = 0;
while ((1U << x) < (unsigned int)(n)) x++;
return x;
}
#line 1 "math/ceil_pow2.hpp"
int ceil_pow2(int n) {
int x = 0;
while ((1U << x) < (unsigned int)(n)) x++;
return x;
}