C examples for complex.h:conj
function template
<complex> <complex.h>
complex<double> conj (ArithmeticType x); template<class T> complex<T> conj (const complex<T>& x);
Returns the conjugate of the complex number x. The conjugate of a complex number (real,imag) is (real,-imag).
Parameter | Description |
---|---|
x | Complex value. |
Complex conjugate value of x.
#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; }