Reference
C Library
IOstream Library
Strings library
STL Containers
STL Algorithms
Miscellaneous
Miscellaneous
complex
exception
functional
iterator
limits
locale
memory
new
numeric
stdexcept
typeinfo
utility
valarray
complex
abs
arg
complex
conj
cos
cosh
exp
imag
log
log10
norm
polar
pow
real
sin
sinh
sqrt
tan
tanh


log

function template
<complex>
template<class T> complex<T> log (const complex<T>& x);

Return natural logarithm of complex

Returns the natural (base-e) logarithm of the complex number x using the principal branch, whose cuts are along the negative real axis.

The value computed is bounded along the imaginary axis between [-i*PI,i*PI].
When x is a negative real number, log(x).imag() is PI.

This overloads cmath's log function.

Parameters

x
Complex value.

Return value

Natural logarithm of x.

See also