#include <cmath>
#include
double log2 (double x)
Liefert den Logarithmus von x zur Basis 2 für x>0.
x
Rückgabewert: log(x)/log(2.0).
log(x)/log(2.0)
exp2(), log(), log10().
#include <cmath> #include <iostream> int main() { std::cout << "log2(8.0) = " << std::log2(8.0) << '\n'; }