function template
<complex>
std::conj complex (1)template<class T> complex<T> conj (const complex<T>& x);complex (1)
template<class T> complex<T> conj (const complex<T>& x);arithmetic type (2)
complex<double> conj (ArithmeticType x);
Complex conjugate
Returns the conjugate of the complex number x.The conjugate of a complex number (real,imag)
is (real,-imag)
.
Only available for instantiations of
complex.
are provided for arguments of any
fundamental arithmetic type: In this case, the function assumes the value has a zero
imaginarycomponent.
The return type is
complex<double>
, except if the argument is
float
or
long double
(in which case, the return type is the
complexinstantiation for that type: either
complex<float>
or
complex<long double>
).
1
2
3
4
5
6
7
8
9
10
11
12
// conj example
#include <iostream> // std::cout
#include <complex> // std::complex, std::conj
int main ()
{
std::complex<double> mycomplex (10.0,2.0);
std::cout << "The conjugate of " << mycomplex << " is " << std::conj(mycomplex) << '\n';
return 0;
}
The conjugate of (10,2) is (10,-2)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4