Namespaces
Variants
Views
Actions

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

From cppreference.com
< cpp‎ | numeric‎ | complex
Revision as of 10:36, 23 April 2013 by P12 (Talk | contribs)

Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <complex>
</td>

<td></td> <td></td> <tr class="t-dcl-sep"><td></td><td></td><td></td></tr>

<tr class="t-dcl ">

<td >
template< class T >
bool operator==( const complex<T>& lhs, const complex<T>& rhs);
</td>

<td > (1) </td> <td class="t-dcl-nopad"> </td> </tr> <tr class="t-dcl-sep"><td></td><td></td><td></td></tr>

<tr class="t-dcl ">

<td >
template< class T >
bool operator==( const complex<T>& lhs, const T& rhs);
</td>

<td > (2) </td> <td class="t-dcl-nopad"> </td> </tr> <tr class="t-dcl-sep"><td></td><td></td><td></td></tr>

<tr class="t-dcl ">

<td >
template< class T >
bool operator==( const T& lhs, const complex<T>& rhs);
</td>

<td > (3) </td> <td class="t-dcl-nopad"> </td> </tr> <tr class="t-dcl-sep"><td></td><td></td><td></td></tr>

<tr class="t-dcl ">

<td >
template< class T >
bool operator!=( const complex<T>& lhs, const complex<T>& rhs);
</td>

<td > (4) </td> <td class="t-dcl-nopad"> </td> </tr> <tr class="t-dcl-sep"><td></td><td></td><td></td></tr>

<tr class="t-dcl ">

<td >
template< class T >
bool operator!=( const complex<T>& lhs, const T& rhs);
</td>

<td > (5) </td> <td class="t-dcl-nopad"> </td> </tr> <tr class="t-dcl-sep"><td></td><td></td><td></td></tr>

<tr class="t-dcl ">

<td >
template< class T >
bool operator!=( const T& lhs, const complex<T>& rhs);
</td>

<td > (6) </td> <td class="t-dcl-nopad"> </td> </tr> Template:ddcl list end 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)