That Terminal
A terminal emulator designed for video making purposes.
log2.hh
Go to the documentation of this file.
1 #ifndef bqtNewNewLog2HH
2 #define bqtNewNewLog2HH
7 #include <cstdint>
8 
17 static constexpr std::size_t log2floor(std::size_t n) { return n<2 ? 0 : (1+log2floor((n+1)/2)); }
18 
22 static constexpr std::size_t log2ceil(std::size_t n) { return log2floor(n) + !(n & (n-1)); }
23 
24 #endif