sqrt - C complex.h

C examples for complex.h:sqrt

type

function template

From


<complex>
<complex.h>

Prototype

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

Description

Square root of complex

Parameters

Parameter Description
x Complex value.

Return value

Square root of x.

Demo Code


#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;
}

Related Tutorials