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 . 그런 다음, 생성자를 1과 같은 실제 부분과 0과 같은 가상 부분으로 호출 Complex 하여 인스턴스화되는 다른 값과 이 값을 비교합니다. 예제의 출력에서와 같이 두 값은 같습니다.

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
open System.Numerics

let value = Complex.One
printfn $"{value}"

// Instantiate a complex number with real part 1 and imaginary part 0.
let value1 = Complex(1., 0.)
printfn $"{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

적용 대상

추가 정보