Inhaltsverzeichnis

ilogb()

#include <cmath>

int ilogb (double x) 

Liefert den ganzzahligen Logarithmus von x zur Basis 2 für x>0.

Parameter

x positiver, reeller Logarithmand

Ergebnis

Rückgabewert: int(log2(x)).

Siehe auch

ldexp(), log2(), logb().

Beispiel

ilogb.cpp
#include <cmath>
#include <iostream>
 
int main()
{
  std::cout << "ilogb(8.0) = " << std::ilogb(8.0) << '\n';
}