# Complex.Equality(Complex, Complex)Complex.Equality(Complex, Complex)Complex.Equality(Complex, Complex)Complex.Equality(Complex, Complex) Operator

## 定義

2 つの複素数が等しいかどうかを示す値を返します。Returns a value that indicates whether two complex numbers are equal.

``````public:
static bool operator ==(System::Numerics::Complex left, System::Numerics::Complex right);``````
``public static bool operator == (System.Numerics.Complex left, System.Numerics.Complex right);``
``static member ( = ) : System.Numerics.Complex * System.Numerics.Complex -> bool``
``Public Shared Operator == (left As Complex, right As Complex) As Boolean``

#### パラメーター

left
Complex Complex Complex Complex

right
Complex Complex Complex Complex

#### 戻り値

`left` パラメーターと `right` パラメーターが同じ値の場合は `true`。それ以外の場合は `false``true` if the `left` and `right` parameters have the same value; otherwise, `false`.

## 注釈

メソッドEqualityは、値のComplex等値演算子の演算を定義します。The Equality method defines the operation of the equality operator for Complex values. 次のようなコードが有効になります。It enables code such as the following:

``````Complex c1 = new Complex(12.6, 4.3);
Complex c2 = new Complex(11.1, 8.9);
if (c1 == c2)
``````
``````Dim c1 As New Complex(12.6, 4.3)
Dim c2 As New Complex(11.1, 8.9)
If c1 = c2 Then
``````

カスタム演算子をサポートしない言語では、 Equals(Complex)代わりにメソッドを呼び出すことができます。Languages that do not support custom operators can call the Equals(Complex) method instead.

2つの複素数は、実数部が等しく、虚数部が等しい場合に等しくなります。Two complex numbers are equal if their real parts are equal and their imaginary parts are equal. Equalityメソッドは、次の式と同じです。The Equality method is equivalent to the following expression:

``````return this.Real == value.Real && this.Imaginary == value.Imaginary;
``````
``````Return Me.Real = value.Real AndAlso Me.Imaginary = value.Imaginary
``````

この演算子の同等の方法は次のようになります。Complex.EqualsThe equivalent method for this operator is Complex.Equals