Complex.One Feld

Definition

Gibt eine neue Complex-Instanz mit einer reellen Zahl gleich 1 und einer imaginären Zahl gleich 0 zurück.

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 

Feldwert

Beispiele

Im folgenden Beispiel wird ein Complex Wert mithilfe der One -Eigenschaft instanziiert. Anschließend wird dieser Wert mit einem anderen Wert verglichen, der durch Aufrufen des Complex Konstruktors mit einem realen Teil gleich 1 und einem imaginären Teil gleich 0 instanziiert wird. Wie die Ausgabe aus dem Beispiel zeigt, sind die beiden Werte gleich.

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

Gilt für:

Weitere Informationen