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


conj

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

Return complex conjugate

Returns the complex conjugate of the complex number x.

The conjugation of a complex number (real,imag) is (real,-imag).

Parameters

x
Complex value.

Return value

Complex conjugate value of x.

Example

1
2
3
4
5
6
7
8
9
10
11
12
13
// conj example
#include <iostream>
#include <complex>
using namespace std;
int main ()
{
  complex<double> mycomplex (10.0,2.0);
  cout << "The conjugate of " << mycomplex << " is " << conj(mycomplex) << endl;
  return 0;
} 


Output:

The conjugate of (10,2) is (10,-2)

See also