function template
std::conj
<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
- abs
- Return absolute value of complex (function template
)
- sin
- Return sine of complex (function template)