Complex.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
フィールド値
例
次の例では、 Complex プロパティを使用して値をインスタンス化し Zero ます。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プロパティは、値を0と比較するために最も頻繁に使用され Complex ます。The Zero property is most frequently used to compare a Complex value to zero.