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

operators (std::complex)

运算符=,%21=%28std::Complex%29

Defined in header
template< class T > bool operator==( const complex<T>& lhs, const complex<T>& rhs(1)(until C++14)
template< class T > constexpr bool operator==( const complex<T>& lhs, const complex<T>& rhs(1)(since C++14)
template< class T > bool operator==( const complex<T>& lhs, const T& rhs(2)(until C++14)
template< class T > constexpr bool operator==( const complex<T>& lhs, const T& rhs(2)(since C++14)
template< class T > bool operator==( const T& lhs, const complex<T>& rhs(3)(until C++14)
template< class T > constexpr bool operator==( const T& lhs, const complex<T>& rhs(3)(since C++14)
template< class T > bool operator!=( const complex<T>& lhs, const complex<T>& rhs(4)(until C++14)
template< class T > constexpr bool operator!=( const complex<T>& lhs, const complex<T>& rhs(4)(since C++14)
template< class T > bool operator!=( const complex<T>& lhs, const T& rhs(5)(until C++14)
template< class T > constexpr bool operator!=( const complex<T>& lhs, const T& rhs(5)(since C++14)
template< class T > bool operator!=( const T& lhs, const complex<T>& rhs(6)(until C++14)
template< class T > constexpr bool operator!=( const T& lhs, const complex<T>& rhs(6)(since C++14)

比较两个复数。标量参数被视为复数,实数等于实数,虚部设为零。

1-3%29比较lhsrhs为了平等。

4-6%29比较lhsrhs不平等。

参数

lhs, rhs-the arguments to compare: either both complex numbers or one complex and one scalar of matching type (float, double, long double)

返回值

1-3%29truelhs等于rhs,,,false否则。

4-6%29!(lhs == rhs)

© cppreference.com

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

http://en.cpPreference.com/w/cpp/数值/复杂/运算符[医]CMP