Function integer_log2

Synopsis

#include "breeze/mathematics/integer_log2.hpp"

constexpr int integer_log2(std::intmax_t x)

Description

Calculates the integer part of the logarithm, to base 2, of its argument.

Precondition
x > 0
Note
This function does not compile with Visual C++ 2015 because the compiler does not yet implement constexpr functions as generalized in C++14.

Source

Line 36 in breeze/mathematics/integer_log2.hpp.