C examples for complex.h:sqrt
function template
<complex> <complex.h>
template<class T> complex<T> sqrt (const complex<T>& x);
Square root of complex
Parameter | Description |
---|---|
x | Complex value. |
Square root of x.
#include <iostream> // std::cout #include <complex> // std::complex, std::real int main ()//from w w w. java2 s .c o m { std::complex<double> mycomplex (10.0,1.0); std::cout << std::sqrt(mycomplex) << '\n'; return 0; }