complex - STL C++

conj()

Declaration

complex<X> conj(const complex<X>& kqrZ);

Description

This is the friend function conj() for complex numbers. It returns the conjugate of the complex number kqrZ.

Header Include

#include <complex>

Example

#include <complex>
#include <iostream>

int main()
{
	using namespace std;

	// Create a complex number and calculate its conjugate
	complex<double> qZ(2.0, 4.0);
	cout << "Complex Number : "<< qZ << endl;
	cout << "The conjugate is "<< conj(qZ) << endl;

	// Keep the window open
	cin.get();
	return 0;
}

Output

conj() Output
 

© 2007–2024 XoaX.net LLC. All rights reserved.