std::log

From Cppreference

Jump to: navigation, search
Defined in header <cmath>

float       log( float arg );

double      log( double arg );

long double log( long double arg );

Computes the natural (base e) logarithm of arg.

[edit] Parameters

arg - floating point value

[edit] Return value

natural logarithm of 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.

[edit] See also

exp
returns e raised to the given power (ex)
(function)
log10
computes common (base 10) logarithm (log10(x))
(function)
pow
raises a number to the given power (xy)
(function)