std::complex类conj

std::conj(std::complex)

std::conj(std::complex)用来计算complex的共轭部分,通过相反虚部的标识。

example:

1 #include 
2 #include 
3  
4 int main()
5 {
6     std::complex<double> z(1,2);
7     std::cout << "The conjugate of " << z << " is " << std::conj(z) << '\n'
8               << "Their product is " << z*std::conj(z) << '\n';
9 }

output:

The conjugate of (1,2) is (1,-2)
Their product is (5,0)

转载于:https://www.cnblogs.com/liangyi322/p/10053018.html

你可能感兴趣的:(std::complex类conj)