Compute the base2 logarithm of a number
Synopsis:
#include <math.h>
double log2( double x );
float log2f( float x );
long double log2l( long double x );
Arguments:
 x
 The number that you want to compute the base2 log of.
Library:
libm
Use the l m option to
qcc
to link against this library.
Description:
The log2(), log2f(), and log2l() functions
compute the base2 logarithm of x:
log_{2}x
To check for error situations, use
feclearexcept()
and
fetestexcept():
 Call feclearexcept(FE_ALL_EXCEPT) before calling
log2(), log2f(), or log2l().
 On return, if fetestexcept(FE_INVALID  FE_DIVBYZERO  FE_OVERFLOW  FE_UNDERFLOW)
is nonzero, then an error has occurred.
Returns:
The base2 logarithm of x.
 If x is ±0, a pole error occurs, and these functions return HUGE_VAL,
HUGE_VALF, and HUGE_VALL, respectively.
 For finite values of x that are less than 0, or if x is Inf,
a domain error occurs, and NaN is returned.
 If x is NaN, NaN is returned.
 If x is 1, +0 is returned.
 If x is +Inf, x is returned.
Errors:
 FE_DIVBYZERO
 The value of x is 0.
 FE_INVALID
 The finite value of x is less than 0, or x is Inf.
Classification:
ANSI,
POSIX 1003.1
Safety: 

Cancellation point 
No 
Interrupt handler 
No 
Signal handler 
No 
Thread 
Yes 