operator==,!=(std::complex) (3) - Linux Manuals

operator==,!=(std::complex): operator==,!=(std::complex)

NAME

operator==,!=(std::complex) - operator==,!=(std::complex)

Synopsis


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


Compares two complex numbers. Scalar arguments are treated as complex numbers with the real part equal to the argument and the imaginary part set to zero.
1-3) Compares lhs and rhs for equality.
4-6) Compares lhs and rhs for inequality.

Parameters


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

Return value


1-3) true if respective parts of lhs are equal to rhs, false otherwise.
4-6) !(lhs == rhs)

Example


 This section is incomplete
 Reason: no example