在线文档教程
C++
数字 | Numerics

std::conj(std::complex)

STD::conj%28 std::Complex%29

Defined in header
template< class T > complex<T> conj( const complex<T>& z (1)
std::complex<long double> conj( long double z (2)(since C++11)
template< class DoubleOrInteger > std::complex<double> conj( DoubleOrInteger z (3)(since C++11)
std::complex<float> conj( float z (4)(since C++11)

计算复共轭成z通过倒转假想部分的符号。

%28,因为C++11%提供了29附加过载float,,,double,,,long double,以及所有整数类型,它们被视为零虚分量的复数。

参数

z-complex value

返回值

复共轭z...

二次

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

二次

产出:

二次

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

二次

另见

abs(std::complex)returns the magnitude of a complex number (function template)
normreturns the squared magnitude (function template)
polarconstructs a complex number from magnitude and phase angle (function template)

c CONJ文件

© cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

http://en.cppreference.com/w/cpp/数值/Complex/conj