Complex.Zero Complex.Zero Complex.Zero Complex.Zero Field

定義

実数が 0 で虚数が 0 の新しい Complex インスタンスを返します。Returns a new Complex instance with a real number equal to zero and an imaginary number equal to zero.

public: static initonly System::Numerics::Complex Zero;
public static readonly System.Numerics.Complex Zero;
 staticval mutable Zero : System.Numerics.Complex
Public Shared ReadOnly Zero As Complex 

フィールド値

次の例ではComplexZeroプロパティを使用して値をインスタンス化します。The following example instantiates a Complex value by using the Zero property. 次に、この値を、実数部がゼロ、虚数部Complexが0に等しいコンストラクターを呼び出すことによってインスタンス化される別の値と比較します。It then compares this value to another value that is instantiated by calling the Complex constructor with a real part equal to zero and an imaginary part equal to zero. この例の出力結果が示すように、2つの値は同じです。As the output from the example shows, the two values are equal.

using System;
using System.Numerics;

public class Example
{
   public static void Main()
   {
      Complex value = Complex.Zero;
      Console.WriteLine(value.ToString());
      
      // Instantiate a complex number with real part 0 and imaginary part 1.
      Complex value1 = new Complex(0, 0);
      Console.WriteLine(value.Equals(value1));
   }
}
// The example displays the following output:
//       (0, 0)
//       True
Imports System.Numerics

Module Example
   Public Sub Main()
      Dim value As Complex = Complex.Zero
      Console.WriteLine(value.ToString())
      
      ' Instantiate a complex number with real part 1 and imaginary part 0.
      Dim value1 As New Complex(0, 0)
      Console.WriteLine(value.Equals(value1))
   End Sub
End Module
' The example displays the following output:
'       (0, 0)
'       True

注釈

プロパティZeroは、値をComplex 0 と比較するために最も頻繁に使用されます。The Zero property is most frequently used to compare a Complex value to zero.

適用対象

こちらもご覧ください