#include
<cmath>
int ilogb (double x)
Liefert den ganzzahligen Logarithmus von x
zur Basis 2 für x>0.
x | positiver, reeller Logarithmand |
Rückgabewert: int(log2(x))
.
#include <cmath> #include <iostream> int main() { std::cout << "ilogb(8.0) = " << std::ilogb(8.0) << '\n'; }