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


pow

function template
<complex>
template<class T> complex<T> pow (const complex<T>& x, int y);
template<class T> complex<T> pow (const complex<T>& x, const complex<T>& y);
template<class T> complex<T> pow (const complex<T>& x, const T& y);
template<class T> complex<T> pow (const T& x, const complex<T>& y);

Return complex power

Returns the complex power of base x raised to the y-th power using the principal branch, whose cuts are along the negative real axis, as if computed by:

 
exp(y*log(x))


This overloads cmath's pow function.

Parameters

x
Base value.
T is complex's template type (i.e., its value type).
y
Exponent value.
T is complex's template type (i.e., its value type).

Return value

The result of raising x to the y-th power.
Each library implementation defines how range and domain errors are signaled.

See also