A,B) Additional overloads are provided for all integer and floating-point types, which are treated as complex numbers with zero imaginary component.
(since C++11) [edit] Parameters z - complex value f - floating-point value i - integer value [edit] Return value1) The complex conjugate of z.
[edit] NotesThe additional overloads are not required to be provided exactly as (A,B). They only need to be sufficient to ensure that for their argument num:
T
, then std::conj(num) has the same effect as std::conj(std::complex<T>(num)).#include <complex> #include <iostream> int main() { std::complex<double> z(1.0, 2.0); std::cout << "The conjugate of " << z << " is " << std::conj(z) << '\n' << "Their product is " << z * std::conj(z) << '\n'; }
Output:
The conjugate of (1,2) is (1,-2) Their product is (5,0)[edit] See also
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