Namespaces
Variants
Views
Actions

std::log2

From cppreference.com
< cpp‎ | numeric‎ | math
Revision as of 19:35, 26 May 2014 by Diego91b (Talk | contribs)

 
 
 
 
Defined in header <cmath>
float       log2( float arg );
(since C++11)
double      log2( double arg );
(since C++11)
long double log2( long double arg );
(since C++11)
double      log2( Integral arg );
(since C++11)

Computes the base 2 logarithm of arg.

Parameters

arg - value of floating-point or Integral type

Return value

log2(arg)

Domain error occurs if arg is negative. NAN is returned in that case.

Range error occurs if arg is 0. -HUGE_VAL is returned in that case.

See also

(C++11)(C++11)
computes natural (base e) logarithm (ln(x))
(function) [edit]
(C++11)(C++11)
computes common (base 10) logarithm (log10(x))
(function) [edit]
(C++11)(C++11)(C++11)
natural logarithm (to base e) of 1 plus the given number (ln(1+x))
(function) [edit]
(C++11)(C++11)(C++11)
returns 2 raised to the given power (2x)
(function) [edit]