Complex.One フィールド

定義

実数が 1 で虚数が 0 の新しい Complex インスタンスを返します。

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

フィールド値

次の例では、 プロパティを Complex 使用して値を One インスタンス化します。 次に、この値を、コンストラクターを呼び出 Complex すことによってインスタンス化される別の値と比較します。実際の部分は 1 で、虚数部は 0 です。 この例の出力に示すように、2 つの値は等しくなります。

using System;
using System.Numerics;

public class Example
{
   public static void Main()
   {
      Complex value = Complex.One;
      Console.WriteLine(value.ToString());

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

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

適用対象

こちらもご覧ください