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比较lhs
和rhs
为了平等。
4-6%29比较lhs
和rhs
不平等。
参数
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%29true
如lhs
等于rhs
,,,false
否则。
4-6%29!(lhs == rhs)
例
© cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。