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