conj - C complex.h

C examples for complex.h:conj

type

function template

From


<complex>
<complex.h>

Prototype

complex<double> conj (ArithmeticType x);

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

Description

Returns the conjugate of the complex number x. The conjugate of a complex number (real,imag) is (real,-imag).

Parameters

Parameter Description
x Complex value.

Return value

Complex conjugate value of x.

Demo Code


#include <iostream>
#include <complex>

int main ()//  w ww.  j a va 2  s .  c o  m
{
  std::complex<double> mycomplex (10.0,2.0);

  std::cout << "The conjugate of " << mycomplex << " is " << std::conj(mycomplex) << '\n';

  return 0;
}

Related Tutorials