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


sqrt

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

Return square root of complex

Returns the square root of x using the principal branch, whose cuts are along the negative real axis, as if computed by:

The value computed is the range of positive real numbers.
When x is a negative real number, log(x).imag() is positive.

This overloads cmath's sqrt function.

Parameters

x
Complex value.

Return value

The square root of x.

See also