Complex Struktur
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Stellt eine komplexe Zahl dar.
public value class Complex : IEquatable<System::Numerics::Complex>, IFormattable
public value class Complex : IEquatable<System::Numerics::Complex>, IParsable<System::Numerics::Complex>, ISpanParsable<System::Numerics::Complex>, IUtf8SpanParsable<System::Numerics::Complex>, System::Numerics::IAdditionOperators<System::Numerics::Complex, System::Numerics::Complex, System::Numerics::Complex>, System::Numerics::IAdditiveIdentity<System::Numerics::Complex, System::Numerics::Complex>, System::Numerics::IDecrementOperators<System::Numerics::Complex>, System::Numerics::IDivisionOperators<System::Numerics::Complex, System::Numerics::Complex, System::Numerics::Complex>, System::Numerics::IEqualityOperators<System::Numerics::Complex, System::Numerics::Complex, bool>, System::Numerics::IIncrementOperators<System::Numerics::Complex>, System::Numerics::IMultiplicativeIdentity<System::Numerics::Complex, System::Numerics::Complex>, System::Numerics::IMultiplyOperators<System::Numerics::Complex, System::Numerics::Complex, System::Numerics::Complex>, System::Numerics::INumberBase<System::Numerics::Complex>, System::Numerics::ISignedNumber<System::Numerics::Complex>, System::Numerics::ISubtractionOperators<System::Numerics::Complex, System::Numerics::Complex, System::Numerics::Complex>, System::Numerics::IUnaryNegationOperators<System::Numerics::Complex, System::Numerics::Complex>, System::Numerics::IUnaryPlusOperators<System::Numerics::Complex, System::Numerics::Complex>
public value class Complex : IEquatable<System::Numerics::Complex>, IParsable<System::Numerics::Complex>, ISpanParsable<System::Numerics::Complex>, System::Numerics::IAdditionOperators<System::Numerics::Complex, System::Numerics::Complex, System::Numerics::Complex>, System::Numerics::IAdditiveIdentity<System::Numerics::Complex, System::Numerics::Complex>, System::Numerics::IDecrementOperators<System::Numerics::Complex>, System::Numerics::IDivisionOperators<System::Numerics::Complex, System::Numerics::Complex, System::Numerics::Complex>, System::Numerics::IEqualityOperators<System::Numerics::Complex, System::Numerics::Complex, bool>, System::Numerics::IIncrementOperators<System::Numerics::Complex>, System::Numerics::IMultiplicativeIdentity<System::Numerics::Complex, System::Numerics::Complex>, System::Numerics::IMultiplyOperators<System::Numerics::Complex, System::Numerics::Complex, System::Numerics::Complex>, System::Numerics::INumberBase<System::Numerics::Complex>, System::Numerics::ISignedNumber<System::Numerics::Complex>, System::Numerics::ISubtractionOperators<System::Numerics::Complex, System::Numerics::Complex, System::Numerics::Complex>, System::Numerics::IUnaryNegationOperators<System::Numerics::Complex, System::Numerics::Complex>, System::Numerics::IUnaryPlusOperators<System::Numerics::Complex, System::Numerics::Complex>
public struct Complex : IEquatable<System.Numerics.Complex>, IFormattable
public readonly struct Complex : IEquatable<System.Numerics.Complex>, IParsable<System.Numerics.Complex>, ISpanParsable<System.Numerics.Complex>, IUtf8SpanParsable<System.Numerics.Complex>, System.Numerics.IAdditionOperators<System.Numerics.Complex,System.Numerics.Complex,System.Numerics.Complex>, System.Numerics.IAdditiveIdentity<System.Numerics.Complex,System.Numerics.Complex>, System.Numerics.IDecrementOperators<System.Numerics.Complex>, System.Numerics.IDivisionOperators<System.Numerics.Complex,System.Numerics.Complex,System.Numerics.Complex>, System.Numerics.IEqualityOperators<System.Numerics.Complex,System.Numerics.Complex,bool>, System.Numerics.IIncrementOperators<System.Numerics.Complex>, System.Numerics.IMultiplicativeIdentity<System.Numerics.Complex,System.Numerics.Complex>, System.Numerics.IMultiplyOperators<System.Numerics.Complex,System.Numerics.Complex,System.Numerics.Complex>, System.Numerics.INumberBase<System.Numerics.Complex>, System.Numerics.ISignedNumber<System.Numerics.Complex>, System.Numerics.ISubtractionOperators<System.Numerics.Complex,System.Numerics.Complex,System.Numerics.Complex>, System.Numerics.IUnaryNegationOperators<System.Numerics.Complex,System.Numerics.Complex>, System.Numerics.IUnaryPlusOperators<System.Numerics.Complex,System.Numerics.Complex>
public readonly struct Complex : IEquatable<System.Numerics.Complex>, IFormattable
public readonly struct Complex : IEquatable<System.Numerics.Complex>, IParsable<System.Numerics.Complex>, ISpanParsable<System.Numerics.Complex>, System.Numerics.IAdditionOperators<System.Numerics.Complex,System.Numerics.Complex,System.Numerics.Complex>, System.Numerics.IAdditiveIdentity<System.Numerics.Complex,System.Numerics.Complex>, System.Numerics.IDecrementOperators<System.Numerics.Complex>, System.Numerics.IDivisionOperators<System.Numerics.Complex,System.Numerics.Complex,System.Numerics.Complex>, System.Numerics.IEqualityOperators<System.Numerics.Complex,System.Numerics.Complex,bool>, System.Numerics.IIncrementOperators<System.Numerics.Complex>, System.Numerics.IMultiplicativeIdentity<System.Numerics.Complex,System.Numerics.Complex>, System.Numerics.IMultiplyOperators<System.Numerics.Complex,System.Numerics.Complex,System.Numerics.Complex>, System.Numerics.INumberBase<System.Numerics.Complex>, System.Numerics.ISignedNumber<System.Numerics.Complex>, System.Numerics.ISubtractionOperators<System.Numerics.Complex,System.Numerics.Complex,System.Numerics.Complex>, System.Numerics.IUnaryNegationOperators<System.Numerics.Complex,System.Numerics.Complex>, System.Numerics.IUnaryPlusOperators<System.Numerics.Complex,System.Numerics.Complex>
[System.Serializable]
public struct Complex : IEquatable<System.Numerics.Complex>, IFormattable
type Complex = struct
interface IFormattable
type Complex = struct
interface IFormattable
interface IParsable<Complex>
interface ISpanFormattable
interface ISpanParsable<Complex>
interface IAdditionOperators<Complex, Complex, Complex>
interface IAdditiveIdentity<Complex, Complex>
interface IDecrementOperators<Complex>
interface IDivisionOperators<Complex, Complex, Complex>
interface IEqualityOperators<Complex, Complex, bool>
interface IIncrementOperators<Complex>
interface IMultiplicativeIdentity<Complex, Complex>
interface IMultiplyOperators<Complex, Complex, Complex>
interface INumberBase<Complex>
interface IUtf8SpanFormattable
interface IUtf8SpanParsable<Complex>
interface ISubtractionOperators<Complex, Complex, Complex>
interface IUnaryNegationOperators<Complex, Complex>
interface IUnaryPlusOperators<Complex, Complex>
interface ISignedNumber<Complex>
type Complex = struct
interface IFormattable
interface IParsable<Complex>
interface ISpanFormattable
interface ISpanParsable<Complex>
interface IUtf8SpanFormattable
interface IUtf8SpanParsable<Complex>
interface IAdditionOperators<Complex, Complex, Complex>
interface IAdditiveIdentity<Complex, Complex>
interface IDecrementOperators<Complex>
interface IDivisionOperators<Complex, Complex, Complex>
interface IEqualityOperators<Complex, Complex, bool>
interface IIncrementOperators<Complex>
interface IMultiplicativeIdentity<Complex, Complex>
interface IMultiplyOperators<Complex, Complex, Complex>
interface INumberBase<Complex>
interface ISubtractionOperators<Complex, Complex, Complex>
interface IUnaryNegationOperators<Complex, Complex>
interface IUnaryPlusOperators<Complex, Complex>
interface ISignedNumber<Complex>
type Complex = struct
interface IFormattable
interface IParsable<Complex>
interface ISpanFormattable
interface ISpanParsable<Complex>
interface IAdditionOperators<Complex, Complex, Complex>
interface IAdditiveIdentity<Complex, Complex>
interface IDecrementOperators<Complex>
interface IDivisionOperators<Complex, Complex, Complex>
interface IEqualityOperators<Complex, Complex, bool>
interface IIncrementOperators<Complex>
interface IMultiplicativeIdentity<Complex, Complex>
interface IMultiplyOperators<Complex, Complex, Complex>
interface INumberBase<Complex>
interface ISubtractionOperators<Complex, Complex, Complex>
interface IUnaryNegationOperators<Complex, Complex>
interface IUnaryPlusOperators<Complex, Complex>
interface ISignedNumber<Complex>
type Complex = struct
interface IFormattable
interface IParsable<Complex>
interface ISpanFormattable
interface ISpanParsable<Complex>
interface IAdditionOperators<Complex, Complex, Complex>
interface IAdditiveIdentity<Complex, Complex>
interface IDecrementOperators<Complex>
interface IDivisionOperators<Complex, Complex, Complex>
interface IEqualityOperators<Complex, Complex, bool>
interface IIncrementOperators<Complex>
interface IMultiplicativeIdentity<Complex, Complex>
interface IMultiplyOperators<Complex, Complex, Complex>
interface INumberBase<Complex>
interface ISubtractionOperators<Complex, Complex, Complex>
interface IUnaryNegationOperators<Complex, Complex>
interface IUnaryPlusOperators<Complex, Complex>
interface IUtf8SpanFormattable
interface IUtf8SpanParsable<Complex>
interface ISignedNumber<Complex>
[<System.Serializable>]
type Complex = struct
interface IFormattable
Public Structure Complex
Implements IEquatable(Of Complex), IFormattable
Public Structure Complex
Implements IAdditionOperators(Of Complex, Complex, Complex), IAdditiveIdentity(Of Complex, Complex), IDecrementOperators(Of Complex), IDivisionOperators(Of Complex, Complex, Complex), IEqualityOperators(Of Complex, Complex, Boolean), IEquatable(Of Complex), IIncrementOperators(Of Complex), IMultiplicativeIdentity(Of Complex, Complex), IMultiplyOperators(Of Complex, Complex, Complex), INumberBase(Of Complex), IParsable(Of Complex), ISignedNumber(Of Complex), ISpanParsable(Of Complex), ISubtractionOperators(Of Complex, Complex, Complex), IUnaryNegationOperators(Of Complex, Complex), IUnaryPlusOperators(Of Complex, Complex), IUtf8SpanParsable(Of Complex)
Public Structure Complex
Implements IAdditionOperators(Of Complex, Complex, Complex), IAdditiveIdentity(Of Complex, Complex), IDecrementOperators(Of Complex), IDivisionOperators(Of Complex, Complex, Complex), IEqualityOperators(Of Complex, Complex, Boolean), IEquatable(Of Complex), IIncrementOperators(Of Complex), IMultiplicativeIdentity(Of Complex, Complex), IMultiplyOperators(Of Complex, Complex, Complex), INumberBase(Of Complex), IParsable(Of Complex), ISignedNumber(Of Complex), ISpanParsable(Of Complex), ISubtractionOperators(Of Complex, Complex, Complex), IUnaryNegationOperators(Of Complex, Complex), IUnaryPlusOperators(Of Complex, Complex)
- Vererbung
- Attribute
- Implementiert
-
IEquatable<Complex> IFormattable IEquatable<TSelf> IParsable<Complex> IParsable<TSelf> ISpanFormattable ISpanParsable<Complex> ISpanParsable<TSelf> IUtf8SpanFormattable IUtf8SpanParsable<Complex> IUtf8SpanParsable<TSelf> IAdditionOperators<Complex,Complex,Complex> IAdditionOperators<TSelf,TSelf,TSelf> IAdditiveIdentity<Complex,Complex> IAdditiveIdentity<TSelf,TSelf> IDecrementOperators<Complex> IDecrementOperators<TSelf> IDivisionOperators<Complex,Complex,Complex> IDivisionOperators<TSelf,TSelf,TSelf> IEqualityOperators<Complex,Complex,Boolean> IEqualityOperators<TSelf,TSelf,Boolean> IIncrementOperators<Complex> IIncrementOperators<TSelf> IMultiplicativeIdentity<Complex,Complex> IMultiplicativeIdentity<TSelf,TSelf> IMultiplyOperators<Complex,Complex,Complex> IMultiplyOperators<TSelf,TSelf,TSelf> INumberBase<Complex> INumberBase<TSelf> ISignedNumber<Complex> ISubtractionOperators<Complex,Complex,Complex> ISubtractionOperators<TSelf,TSelf,TSelf> IUnaryNegationOperators<Complex,Complex> IUnaryNegationOperators<TSelf,TSelf> IUnaryPlusOperators<Complex,Complex> IUnaryPlusOperators<TSelf,TSelf>
Hinweise
Eine komplexe Zahl ist eine Zahl, die einen reellen Zahlenteil und einen imaginären Zahlenteil umfasst. Eine komplexe Zahl z wird in der Regel in der Form z = x + yigeschrieben, wobei x und y reelle Zahlen sind, und i ist die imaginäre Einheit, die die Eigenschaft i2 = -1 aufweist. Der reale Teil der komplexen Zahl wird durch x dargestellt, und der imaginäre Teil der komplexen Zahl wird durch y dargestellt.
Der Complex Typ verwendet das kartesische Koordinatensystem (real, imaginär) beim Instanziieren und Bearbeiten komplexer Zahlen. Eine komplexe Zahl kann als Punkt in einem zweidimensionalen Koordinatensystem dargestellt werden, das als komplexe Ebene bezeichnet wird. Der reale Teil der komplexen Zahl wird auf der X-Achse (der horizontalen Achse) positioniert, und der imaginäre Teil wird auf der y-Achse (der vertikalen Achse) positioniert.
Jeder Punkt in der komplexen Ebene kann auch anhand seines absoluten Werts ausgedrückt werden, indem das Polarkoordinatensystem verwendet wird. In polaren Koordinaten zeichnet sich ein Punkt durch zwei Zahlen aus:
- Seine Größe, die der Abstand des Punkts vom Ursprung ist (d. h. 0,0 oder der Punkt, an dem sich die x-Achse und die Y-Achse schneiden).
- Die Phase, bei der es sich um den Winkel zwischen der realen Achse und der Linie handelt, die vom Ursprung zum Punkt gezeichnet wird.
Instanziieren einer komplexen Zahl
Sie können einer komplexen Zahl auf eine der folgenden Arten einen Wert zuweisen:
Durch Übergeben von zwei Double Werten an den Konstruktor. Der erste Wert stellt den tatsächlichen Teil der komplexen Zahl dar, und der zweite Wert stellt seinen imaginären Teil dar. Diese Werte stellen die Position der komplexen Zahl im zweidimensionalen kartesischen Koordinatensystem dar.
Durch Aufrufen der statischen (
Sharedin Visual Basic) Complex.FromPolarCoordinates -Methode zum Erstellen einer komplexen Zahl aus den Polarkoordinaten.Durch das Zuweisen eines Byte, SByte, Int16, UInt16, Int32, UInt32, Int64, UInt64, Single oder Double Werts zu einem Complex Objekt. Der Wert wird der reale Teil der komplexen Zahl, und sein imaginärer Teil entspricht 0.
Durch Casten (in C#) oder Konvertieren (in Visual Basic) wird ein Decimal- oder BigInteger-Wert in ein Complex-Objekt umgewandelt. Der Wert wird der reale Teil der komplexen Zahl, und sein imaginärer Teil entspricht 0.
Durch Zuweisen der komplexen Zahl, die von einer Methode oder einem Operator einem Complex Objekt zurückgegeben wird. Ist beispielsweise eine statische Methode, die eine komplexe Zahl zurückgibt, Complex.Add die die Summe von zwei komplexen Zahlen darstellt, und der Complex.Addition Operator addiert zwei komplexe Zahlen und gibt das Ergebnis zurück.
Das folgende Beispiel veranschaulicht jede dieser fünf Methoden zum Zuweisen eines Werts zu einer komplexen Zahl.
using System;
using System.Numerics;
public class CreateEx
{
public static void Run()
{
// Create a complex number by calling its class constructor.
Complex c1 = new Complex(12, 6);
Console.WriteLine(c1);
// Assign a Double to a complex number.
Complex c2 = 3.14;
Console.WriteLine(c2);
// Cast a Decimal to a complex number.
Complex c3 = (Complex)12.3m;
Console.WriteLine(c3);
// Assign the return value of a method to a Complex variable.
Complex c4 = Complex.Pow(Complex.One, -1);
Console.WriteLine(c4);
// Assign the value returned by an operator to a Complex variable.
Complex c5 = Complex.One + Complex.One;
Console.WriteLine(c5);
// Instantiate a complex number from its polar coordinates.
Complex c6 = Complex.FromPolarCoordinates(10, .524);
Console.WriteLine(c6);
}
}
// The example displays the following output:
// (12, 6)
// (3.14, 0)
// (12.3, 0)
// (1, 0)
// (2, 0)
// (8.65824721882145, 5.00347430269914)
Imports System.Numerics
Module Example
Public Sub Run()
' Create a complex number by calling its class constructor.
Dim c1 As New Complex(12, 6)
Console.WriteLine(c1)
' Assign a Double to a complex number.
Dim c2 As Complex = 3.14
Console.WriteLine(c2)
' Cast a Decimal to a complex number.
Dim c3 As Complex = CType(12.3d, Complex)
Console.WriteLine(c3)
' Assign the return value of a method to a Complex variable.
Dim c4 As Complex = Complex.Pow(Complex.One, -1)
Console.WriteLine(c4)
' Assign the value returned by an operator to a Complex variable.
Dim c5 As Complex = Complex.One + Complex.One
Console.WriteLine(c5)
' Instantiate a complex number from its polar coordinates.
Dim c6 As Complex = Complex.FromPolarCoordinates(10, .524)
Console.WriteLine(c6)
End Sub
End Module
' The example displays the following output:
' (12, 6)
' (3.14, 0)
' (12.3000001907349, 0)
' (1, 0)
' (2, 0)
' (8.65824721882145, 5.00347430269914)
Vorgänge mit komplexen Zahlen
Die Complex Struktur in .NET enthält Member, die die folgenden Funktionen bereitstellen:
- Methoden zum Vergleichen von zwei komplexen Zahlen, um zu bestimmen, ob sie gleich sind.
- Operatoren zum Ausführen von arithmetischen Vorgängen für komplexe Zahlen. Complex Operatoren ermöglichen es Ihnen, Addition, Subtraktion, Multiplikation, Division und unäre Negation mit komplexen Zahlen durchzuführen.
- Methoden zum Ausführen anderer numerischer Vorgänge für komplexe Zahlen. Zusätzlich zu den vier grundlegenden arithmetischen Operationen können Sie eine komplexe Zahl auf eine angegebene Potenz erhöhen, die Quadratwurzel einer komplexen Zahl suchen und den Absolutenwert einer komplexen Zahl abrufen.
- Methoden zum Ausführen von trigonometrischen Vorgängen für komplexe Zahlen. Sie können beispielsweise den Tangens eines Winkels berechnen, der durch eine komplexe Zahl dargestellt wird.
Beachten Sie, dass Sie den Wert eines vorhandenen Real-Objekts nicht ändern können, da die Imaginary- und Complex-Eigenschaften schreibgeschützt sind. Alle Methoden, die einen Vorgang für eine Complex Zahl ausführen, wenn ihr Rückgabewert vom Typ Complexist, geben eine neue Complex Zahl zurück.
Genauigkeit und komplexe Zahlen
Die realen und imaginären Teile einer komplexen Zahl werden durch zwei Gleitkommawerte mit doppelter Genauigkeit dargestellt. Dies bedeutet, dass Complex Werte wie Gleitkommawerte mit doppelter Genauigkeit aufgrund numerischer Vorgänge die Genauigkeit verlieren können. Dies bedeutet, dass strenge Vergleiche für die Gleichheit von zwei Complex Werten fehlschlagen können, auch wenn der Unterschied zwischen den beiden Werten auf einen Genauigkeitsverlust zurückzuführen ist. Weitere Informationen finden Sie unter Double.
Beispielsweise sollte beim Ausführen der Exponentiation auf dem Logarithmus einer Zahl die ursprüngliche Zahl zurückgegeben werden. In einigen Fällen kann der Verlust der Genauigkeit von Gleitkommawerten jedoch geringfügige Unterschiede zwischen den beiden Werten verursachen, wie im folgenden Beispiel dargestellt.
Complex value = new Complex(Double.MinValue / 2, Double.MinValue / 2);
Complex value2 = Complex.Exp(Complex.Log(value));
Console.WriteLine($"{value} \n{value2} \nEqual: {value == value2}");
// The example displays the following output:
// (-8.98846567431158E+307, -8.98846567431158E+307)
// (-8.98846567431161E+307, -8.98846567431161E+307)
// Equal: False
Dim value As New Complex(Double.MinValue / 2, Double.MinValue / 2)
Dim value2 As Complex = Complex.Exp(Complex.Log(value))
Console.WriteLine("{0} {3}{1} {3}Equal: {2}", value, value2,
value = value2,
vbCrLf)
' The example displays the following output:
' (-8.98846567431158E+307, -8.98846567431158E+307)
' (-8.98846567431161E+307, -8.98846567431161E+307)
' Equal: False
Ebenso erzeugt das folgende Beispiel, das die Quadratwurzel einer Complex Zahl berechnet, geringfügig andere Ergebnisse für die 32-Bit- und IA64-Versionen von .NET.
Complex minusOne = new Complex(-1, 0);
Console.WriteLine(Complex.Sqrt(minusOne));
// The example displays the following output:
// (6.12303176911189E-17, 1) on 32-bit systems.
// (6.12323399573677E-17,1) on IA64 systems.
Dim minusOne As New Complex(-1, 0)
Console.WriteLine(Complex.Sqrt(minusOne))
' The example displays the following output:
' (6.12303176911189E-17, 1) on 32-bit systems.
' (6.12323399573677E-17,1) on IA64 systems.
Infinity und NaN
Die realen und imaginären Teile einer komplexen Zahl werden durch Double Werte dargestellt. Neben dem Bereich von Double.MinValue bis Double.MaxValue kann der reale oder imaginäre Teil einer komplexen Zahl einen Wert von Double.PositiveInfinity, Double.NegativeInfinity oder Double.NaN haben. Double.PositiveInfinity, Double.NegativeInfinityund Double.NaN alle werden in arithmetischen oder trigonometrischen Vorgängen verteilt.
Im folgenden Beispiel erzeugt die Division durch Zero eine komplexe Zahl, deren reale und imaginäre Teile beide Double.NaNsind. Dadurch erzeugt die Multiplikation mit diesem Wert auch eine komplexe Zahl, deren reale und imaginäre Teile sind Double.NaN. Ebenso erzeugt das Ausführen einer Multiplikation, die den Bereich des Double Typs überläuft, eine komplexe Zahl, deren realer Teil ist Double.NaN und dessen imaginärer Teil ist Double.PositiveInfinity. Die anschließende Division mit dieser komplexen Zahl gibt eine komplexe Zahl zurück, deren realer Teil ist Double.NaN und dessen imaginärer Teil ist Double.PositiveInfinity.
using System;
using System.Numerics;
public class NaNEx
{
public static void Run()
{
Complex c1 = new Complex(Double.MaxValue / 2, Double.MaxValue / 2);
Complex c2 = c1 / Complex.Zero;
Console.WriteLine(c2.ToString());
c2 = c2 * new Complex(1.5, 1.5);
Console.WriteLine(c2.ToString());
Console.WriteLine();
Complex c3 = c1 * new Complex(2.5, 3.5);
Console.WriteLine(c3.ToString());
c3 = c3 + new Complex(Double.MinValue / 2, Double.MaxValue / 2);
Console.WriteLine(c3);
}
}
// The example displays the following output:
// (NaN, NaN)
// (NaN, NaN)
// (NaN, Infinity)
// (NaN, Infinity)
Imports System.Numerics
Module Example4
Public Sub Run()
Dim c1 As Complex = New Complex(Double.MaxValue / 2, Double.MaxValue / 2)
Dim c2 As Complex = c1 / Complex.Zero
Console.WriteLine(c2.ToString())
c2 = c2 * New Complex(1.5, 1.5)
Console.WriteLine(c2.ToString())
Console.WriteLine()
Dim c3 As Complex = c1 * New Complex(2.5, 3.5)
Console.WriteLine(c3.ToString())
c3 = c3 + New Complex(Double.MinValue / 2, Double.MaxValue / 2)
Console.WriteLine(c3)
End Sub
End Module
' The example displays the following output:
' (NaN, NaN)
' (NaN, NaN)
'
' (NaN, Infinity)
' (NaN, Infinity)
Mathematische Vorgänge mit komplexen Zahlen, die ungültig sind oder den Bereich des Double Datentyps überlaufen, lösen keine Ausnahme aus. Stattdessen geben sie ein Double.PositiveInfinity, Double.NegativeInfinityoder Double.NaN unter den folgenden Bedingungen zurück:
- Die Division einer positiven Zahl durch Null gibt zurück Double.PositiveInfinity.
- Jeder Vorgang, der die obere Grenze des Double Datentyps überläuft, gibt Double.PositiveInfinityzurück.
- Die Division einer negativen Zahl durch Null gibt zurück Double.NegativeInfinity.
- Jeder Vorgang, der die untere Grenze des Double Datentyps überläuft, gibt zurück Double.NegativeInfinity.
- Die Division einer Null durch Null gibt zurück Double.NaN.
- Jeder Vorgang, der für Operanden mit den Werten Double.PositiveInfinity, Double.NegativeInfinity oder Double.NaN ausgeführt wird, gibt in Abhängigkeit vom jeweiligen Vorgang Double.PositiveInfinity, Double.NegativeInfinity oder Double.NaN zurück.
Beachten Sie, dass dies für alle Zwischenberechnungen gilt, die von einer Methode ausgeführt werden. Beispielsweise verwendet die Multiplikation der new Complex(9e308, 9e308) and new Complex(2.5, 3.5) Formel (ac - bd) + (ad + bc)i. Die Berechnung der realen Komponente, die aus der Multiplikation resultiert, wertet den Ausdruck 9e308 2,5 - 9e308 3,5 aus. Jede Zwischenmultiplikation in diesem Ausdruck gibt Double.PositiveInfinity zurück, und der Versuch, Double.PositiveInfinity von Double.PositiveInfinity zu subtrahieren, gibt Double.NaN zurück.
Formatieren einer komplexen Zahl
Standardmäßig wird die Zeichenfolgendarstellung einer komplexen Zahl als <reale; verwendet, wobei > und imaginäre Zeichenfolgendarstellungen der Werte sind, die die realen und imaginären Komponenten der komplexen Zahl bilden. Einige Überladungen der ToString Methode ermöglichen das Anpassen der Zeichenfolgendarstellungen dieser Double Werte, um die Formatierungskonventionen einer bestimmten Kultur widerzuspiegeln oder in einem bestimmten Format zu erscheinen, das durch eine standard- oder benutzerdefinierte zahlenformatierte Zeichenfolge definiert ist. (Weitere Informationen finden Sie unter Zeichenfolgen im numerischen Standardformat und benutzerdefinierte Zahlenformatzeichenfolgen.)
Eine der gängigeren Methoden zum Ausdrücken der Zeichenfolgendarstellung einer komplexen Zahl ist die Form a + bi, wobei a es sich um die reale Komponente der komplexen Zahl handelt und b die imaginäre Komponente der komplexen Zahl ist. In der Elektrotechnik wird eine komplexe Zahl am häufigsten als ausgedrückt.a + bj Sie können die Zeichenfolgendarstellung einer komplexen Zahl in einer dieser beiden Formen zurückgeben. Definieren Sie dazu einen benutzerdefinierten Formatanbieter, indem Sie die ICustomFormatter und IFormatProvider Schnittstellen implementieren und dann die String.Format(IFormatProvider, String, Object[]) Methode aufrufen.
Im folgenden Beispiel wird eine ComplexFormatter-Klasse definiert, die eine komplexe Zahl als Zeichenfolge entweder in der Form von a + bi oder a + bj darstellt.
using System;
using System.Numerics;
public class ComplexFormatter : IFormatProvider, ICustomFormatter
{
public object GetFormat(Type formatType)
{
if (formatType == typeof(ICustomFormatter))
return this;
else
return null;
}
public string Format(string format, object arg,
IFormatProvider provider)
{
if (arg is Complex c1)
{
// Check if the format string has a precision specifier.
int precision;
string fmtString = string.Empty;
if (format.Length > 1)
{
try
{
precision = int.Parse(format.Substring(1));
}
catch (FormatException)
{
precision = 0;
}
fmtString = "N" + precision.ToString();
}
if (format.Substring(0, 1).Equals("I", StringComparison.OrdinalIgnoreCase))
{
// Determine the sign to display.
char sign = c1.Imaginary < 0 ? '-' : '+';
// Display the determined sign and the absolute value of the imaginary part.
return c1.Real.ToString(fmtString) + " " + sign + " " + Math.Abs(c1.Imaginary).ToString(fmtString) + "i";
}
else if (format.Substring(0, 1).Equals("J", StringComparison.OrdinalIgnoreCase))
{
// Determine the sign to display.
char sign = c1.Imaginary < 0 ? '-' : '+';
// Display the determined sign and the absolute value of the imaginary part.
return c1.Real.ToString(fmtString) + " " + sign + " " + Math.Abs(c1.Imaginary).ToString(fmtString) + "j";
}
else
return c1.ToString(format, provider);
}
else
{
if (arg is IFormattable formattable)
return formattable.ToString(format, provider);
else if (arg != null)
return arg.ToString();
else
return string.Empty;
}
}
}
Imports System.Numerics
Public Class ComplexFormatter
Implements IFormatProvider, ICustomFormatter
Public Function GetFormat(formatType As Type) As Object _
Implements IFormatProvider.GetFormat
If formatType Is GetType(ICustomFormatter) Then
Return Me
Else
Return Nothing
End If
End Function
Public Function Format(fmt As String, arg As Object,
provider As IFormatProvider) As String _
Implements ICustomFormatter.Format
If TypeOf arg Is Complex Then
Dim c1 As Complex = DirectCast(arg, Complex)
' Check if the format string has a precision specifier.
Dim precision As Integer
Dim fmtString As String = String.Empty
If fmt.Length > 1 Then
Try
precision = Integer.Parse(fmt.Substring(1))
Catch e As FormatException
precision = 0
End Try
fmtString = "N" + precision.ToString()
End If
' Determine the sign to display.
Dim sign As Char = If(c1.Imaginary < 0.0, "-"c, "+"c)
' Display the determined sign and the absolute value of the imaginary part.
If fmt.Substring(0, 1).Equals("I", StringComparison.OrdinalIgnoreCase) Then
Return c1.Real.ToString(fmtString) + " " + sign + " " + Math.Abs(c1.Imaginary).ToString(fmtString) + "i"
ElseIf fmt.Substring(0, 1).Equals("J", StringComparison.OrdinalIgnoreCase) Then
Return c1.Real.ToString(fmtString) + " " + sign + " " + Math.Abs(c1.Imaginary).ToString(fmtString) + "j"
Else
Return c1.ToString(fmt, provider)
End If
Else
If TypeOf arg Is IFormattable Then
Return DirectCast(arg, IFormattable).ToString(fmt, provider)
ElseIf arg IsNot Nothing Then
Return arg.ToString()
Else
Return String.Empty
End If
End If
End Function
End Class
Im folgenden Beispiel wird dann dieser benutzerdefinierte Formatierer verwendet, um die Zeichenfolgendarstellung einer komplexen Zahl anzuzeigen.
public class CustomFormatEx
{
public static void Run()
{
Complex c1 = new(12.1, 15.4);
Console.WriteLine($"Formatting with ToString: {c1}");
Console.WriteLine($"Formatting with ToString(format): {c1:N2}");
Console.WriteLine($"Custom formatting with I0:\t" +
$" {string.Format(new ComplexFormatter(), "{0:I0}", c1)}");
Console.WriteLine($"Custom formatting with J3:\t" +
$" {string.Format(new ComplexFormatter(), "{0:J3}", c1)}");
}
}
// The example displays the following output:
// Formatting with ToString(): <12.1; 15.4>
// Formatting with ToString(format): <12.10; 15.40>
// Custom formatting with I0: 12 + 15i
// Custom formatting with J3: 12.100 + 15.400j
Module Example2
Public Sub Run()
Dim c1 As New Complex(12.1, 15.4)
Console.WriteLine($"Formatting with ToString(): {c1}")
Console.WriteLine($"Formatting with ToString(format): {c1:N2}")
Console.WriteLine($"Custom formatting with I0: " +
$"{String.Format(New ComplexFormatter(), "{0:I0}", c1)}")
Console.WriteLine($"Custom formatting with J3: " +
$"{String.Format(New ComplexFormatter(), "{0:J3}", c1)}")
End Sub
End Module
' The example displays the following output:
' Formatting with ToString(): <12.1; 15.4>
' Formatting with ToString(format): <12.10; 15.40>
' Custom formatting with I0: 12 + 15i
' Custom formatting with J3: 12.100 + 15.400j
Konstruktoren
| Name | Beschreibung |
|---|---|
| Complex(Double, Double) |
Initialisiert eine neue Instanz der Complex Struktur mithilfe der angegebenen realen und imaginären Werte. |
Felder
| Name | Beschreibung |
|---|---|
| ImaginaryOne |
Gibt eine neue Complex Instanz mit einer reellen Zahl zurück, die null und eine imaginäre Zahl gleich 1 ist. |
| Infinity |
Stellt Unendlichkeit als komplexe Zahl dar. |
| NaN |
Stellt eine komplexe Instanz dar, die keine Zahl (NaN) ist. |
| One |
Gibt eine neue Complex Instanz mit einer reellen Zahl zurück, die gleich einer und einer imaginären Zahl gleich Null ist. |
| Zero |
Gibt eine neue Complex Instanz mit einer reellen Zahl zurück, die null und eine imaginäre Zahl gleich Null ist. |
Eigenschaften
| Name | Beschreibung |
|---|---|
| Imaginary |
Ruft die imaginäre Komponente des aktuellen Complex Objekts ab. |
| Magnitude |
Ruft die Größe (oder den absoluten Wert) einer komplexen Zahl ab. |
| Phase |
Ruft die Phase einer komplexen Zahl ab. |
| Real |
Ruft die reale Komponente des aktuellen Complex Objekts ab. |
Methoden
| Name | Beschreibung |
|---|---|
| Abs(Complex) |
Ruft den absoluten Wert (oder die Größe) einer komplexen Zahl ab. |
| Acos(Complex) |
Gibt den Winkel zurück, der den Arkuskosinus der angegebenen komplexen Zahl darstellt. |
| Add(Complex, Complex) |
Addiert zwei komplexe Zahlen und gibt das Ergebnis zurück. |
| Add(Complex, Double) |
Fügt einer reellen Zahl mit doppelter Genauigkeit eine komplexe Zahl hinzu und gibt das Ergebnis zurück. |
| Add(Double, Complex) |
Fügt einer komplexen Zahl eine reelle Zahl mit doppelter Genauigkeit hinzu und gibt das Ergebnis zurück. |
| Asin(Complex) |
Gibt den Winkel zurück, der den Arkussinus der angegebenen komplexen Zahl darstellt. |
| Atan(Complex) |
Gibt den Winkel zurück, der den Bogen tangens der angegebenen komplexen Zahl darstellt. |
| Conjugate(Complex) |
Berechnet das Konjugat einer komplexen Zahl und gibt das Ergebnis zurück. |
| Cos(Complex) |
Gibt den Kosinus der angegebenen komplexen Zahl zurück. |
| Cosh(Complex) |
Gibt den hyperbolischen Kosinus der angegebenen komplexen Zahl zurück. |
| CreateChecked<TOther>(TOther) |
Erstellt eine Instanz des aktuellen Typs aus einem Wert und löst eine Überlaufausnahme für alle Werte aus, die außerhalb des darstellbaren Bereichs des aktuellen Typs liegen. |
| CreateSaturating<TOther>(TOther) |
Erstellt eine Instanz des aktuellen Typs aus einem Wert, wobei alle Werte gesättigt werden, die außerhalb des darstellbaren Bereichs des aktuellen Typs liegen. |
| CreateTruncating<TOther>(TOther) |
Erstellt eine Instanz des aktuellen Typs aus einem Wert, wobei alle Werte abgeschnitten werden, die außerhalb des darstellbaren Bereichs des aktuellen Typs liegen. |
| Divide(Complex, Complex) |
Dividiert eine komplexe Zahl durch eine andere und gibt das Ergebnis zurück. |
| Divide(Complex, Double) |
Dividiert eine komplexe Zahl durch eine reelle Zahl mit doppelter Genauigkeit und gibt das Ergebnis zurück. |
| Divide(Double, Complex) |
Dividiert eine reelle Zahl mit doppelter Genauigkeit durch eine komplexe Zahl und gibt das Ergebnis zurück. |
| Equals(Complex) |
Gibt einen Wert zurück, der angibt, ob die aktuelle Instanz und eine angegebene komplexe Zahl denselben Wert aufweisen. |
| Equals(Object) |
Gibt einen Wert zurück, der angibt, ob die aktuelle Instanz und ein angegebenes Objekt denselben Wert aufweisen. |
| Exp(Complex) |
Gibt |
| FromPolarCoordinates(Double, Double) |
Erstellt eine komplexe Zahl aus den Polarkoordinaten eines Punkts. |
| GetHashCode() |
Gibt den Hashcode für das aktuelle Complex Objekt zurück. |
| IsComplexNumber(Complex) |
Bestimmt, ob ein Wert einen komplexen Wert darstellt. |
| IsEvenInteger(Complex) |
Bestimmt, ob ein Wert eine gerade integrale Zahl darstellt. |
| IsFinite(Complex) |
Bestimmt, ob die angegebene komplexe Zahl endlich ist. |
| IsImaginaryNumber(Complex) |
Bestimmt, ob ein Wert eine imaginäre Zahl darstellt. |
| IsInfinity(Complex) |
Gibt einen Wert zurück, der angibt, ob die angegebene komplexe Zahl als Unendlichkeit ausgewertet wird. |
| IsInteger(Complex) |
Bestimmt, ob ein Wert einen integralen Wert darstellt. |
| IsNaN(Complex) |
Gibt einen Wert zurück, der angibt, ob die angegebene komplexe Instanz keine Zahl (NaN) ist. |
| IsNegative(Complex) |
Bestimmt, ob ein Wert negativ ist. |
| IsNegativeInfinity(Complex) |
Bestimmt, ob ein Wert negative Unendlichkeit ist. |
| IsNormal(Complex) |
Bestimmt, ob ein Wert normal ist. |
| IsOddInteger(Complex) |
Bestimmt, ob ein Wert eine ungerade integrale Zahl darstellt. |
| IsPositive(Complex) |
Bestimmt, ob ein Wert positiv ist. |
| IsPositiveInfinity(Complex) |
Bestimmt, ob ein Wert positive Unendlichkeit ist. |
| IsRealNumber(Complex) |
Bestimmt, ob ein Wert eine reelle Zahl darstellt. |
| IsSubnormal(Complex) |
Bestimmt, ob ein Wert subnormal ist. |
| Log(Complex, Double) |
Gibt den Logarithmus einer angegebenen komplexen Zahl in einer angegebenen Basis zurück. |
| Log(Complex) |
Gibt den natürlichen Logarithmus einer angegebenen komplexen Zahl zurück |
| Log10(Complex) |
Gibt den Logarithmus der Basis 10 einer angegebenen komplexen Zahl zurück. |
| MaxMagnitude(Complex, Complex) |
Vergleicht zwei Werte mit der Berechnung, die größer ist. |
| MinMagnitude(Complex, Complex) |
Vergleicht zwei Werte mit der Berechnung, die kleiner ist. |
| Multiply(Complex, Complex) |
Gibt das Produkt zweier komplexer Zahlen zurück. |
| Multiply(Complex, Double) |
Gibt das Produkt einer komplexen Zahl und eine reelle Zahl mit doppelter Genauigkeit zurück. |
| Multiply(Double, Complex) |
Gibt das Produkt einer doppelt präzisen reellen Zahl und einer komplexen Zahl zurück. |
| Negate(Complex) |
Gibt die additive Umkehrung einer angegebenen komplexen Zahl zurück. |
| Parse(ReadOnlySpan<Byte>, IFormatProvider) |
Stellt eine komplexe Zahl dar. |
| Parse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider) |
Stellt eine komplexe Zahl dar. |
| Parse(ReadOnlySpan<Char>, IFormatProvider) |
Analysiert eine Spanne von Zeichen in einen Wert. |
| Parse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider) |
Analysiert eine Spanne von Zeichen in einen Wert. |
| Parse(String, IFormatProvider) |
Analysiert eine Zeichenfolge in einen Wert. |
| Parse(String, NumberStyles, IFormatProvider) |
Analysiert eine Zeichenfolge in einen Wert. |
| Pow(Complex, Complex) |
Gibt eine angegebene komplexe Zahl zurück, die mit einer komplexen Zahl angegeben wird. |
| Pow(Complex, Double) |
Gibt eine angegebene komplexe Zahl zurück, die auf eine durch eine Gleitkommazahl mit doppelter Genauigkeit angegebene Potenz erhöht wird. |
| Reciprocal(Complex) |
Gibt die multiplizierte Umkehrung einer komplexen Zahl zurück. |
| Sin(Complex) |
Gibt den Sinus der angegebenen komplexen Zahl zurück. |
| Sinh(Complex) |
Gibt den hyperbolischen Sinus der angegebenen komplexen Zahl zurück. |
| Sqrt(Complex) |
Gibt die Quadratwurzel einer angegebenen komplexen Zahl zurück. |
| Subtract(Complex, Complex) |
Subtrahiert eine komplexe Zahl von einer anderen und gibt das Ergebnis zurück. |
| Subtract(Complex, Double) |
Subtrahiert eine reelle Zahl mit doppelter Genauigkeit von einer komplexen Zahl und gibt das Ergebnis zurück. |
| Subtract(Double, Complex) |
Subtrahiert eine komplexe Zahl von einer reellen Zahl mit doppelter Genauigkeit und gibt das Ergebnis zurück. |
| Tan(Complex) |
Gibt den Tangens der angegebenen komplexen Zahl zurück. |
| Tanh(Complex) |
Gibt den hyperbolischen Tangens der angegebenen komplexen Zahl zurück. |
| ToString() |
Wandelt den Wert der aktuellen komplexen Zahl in die entsprechende Zeichenfolgendarstellung in kartesischer Form um. |
| ToString(IFormatProvider) |
Wandelt den Wert der aktuellen komplexen Zahl mithilfe der angegebenen kulturspezifischen Formatierungsinformationen in die entsprechende Zeichenfolgendarstellung in kartesischer Form um. |
| ToString(String, IFormatProvider) |
Wandelt den Wert der aktuellen komplexen Zahl in die entsprechende Zeichenfolgendarstellung in kartesischer Form um, indem die angegebenen Format- und kulturspezifischen Formatinformationen für die tatsächlichen und imaginären Teile verwendet werden. |
| ToString(String) |
Wandelt den Wert der aktuellen komplexen Zahl in die entsprechende Zeichenfolgendarstellung in kartesischer Form um, indem das angegebene Format für die tatsächlichen und imaginären Teile verwendet wird. |
| TryFormat(Span<Byte>, Int32, ReadOnlySpan<Char>, IFormatProvider) |
Versucht, den Wert der aktuellen Instanz als UTF-8 in die bereitgestellte Bytespanne zu formatieren. |
| TryFormat(Span<Char>, Int32, ReadOnlySpan<Char>, IFormatProvider) |
Versucht, den Wert der aktuellen Instanz in die bereitgestellte Zeichenspanne zu formatieren. |
| TryParse(ReadOnlySpan<Byte>, IFormatProvider, Complex) |
Stellt eine komplexe Zahl dar. |
| TryParse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider, Complex) |
Stellt eine komplexe Zahl dar. |
| TryParse(ReadOnlySpan<Char>, IFormatProvider, Complex) |
Versucht, einen Bereich von Zeichen in einen Wert zu analysieren. |
| TryParse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider, Complex) |
Versucht, einen Bereich von Zeichen in einen Wert zu analysieren. |
| TryParse(String, IFormatProvider, Complex) |
Versucht, eine Zeichenfolge in einen Wert zu analysieren. |
| TryParse(String, NumberStyles, IFormatProvider, Complex) |
Versucht, eine Zeichenfolge in einen Wert zu analysieren. |
Operatoren
| Name | Beschreibung |
|---|---|
| Addition(Complex, Complex) |
Addiert zwei komplexe Zahlen. |
| Addition(Complex, Double) |
Fügt einer reellen Zahl mit doppelter Genauigkeit eine komplexe Zahl hinzu. |
| Addition(Double, Complex) |
Fügt einer komplexen Zahl eine reelle Zahl mit doppelter Genauigkeit hinzu. |
| Decrement(Complex) |
Erhöht einen Wert. |
| Division(Complex, Complex) |
Dividiert eine angegebene komplexe Zahl durch eine andere angegebene komplexe Zahl. |
| Division(Complex, Double) |
Dividiert eine angegebene komplexe Zahl durch eine angegebene reelle Zahl mit doppelter Genauigkeit. |
| Division(Double, Complex) |
Dividiert eine angegebene reelle Zahl mit doppelter Genauigkeit durch eine angegebene komplexe Zahl. |
| Equality(Complex, Complex) |
Gibt einen Wert zurück, der angibt, ob zwei komplexe Zahlen gleich sind. |
| Explicit(BigInteger to Complex) |
Definiert eine explizite Konvertierung eines BigInteger Werts in eine komplexe Zahl. |
| Explicit(Decimal to Complex) |
Definiert eine explizite Konvertierung eines Decimal Werts in eine komplexe Zahl. |
| Explicit(Int128 to Complex) |
Wandelt einen Int128 Wert explizit in eine komplexe Zahl mit doppelter Genauigkeit um. |
| Explicit(UInt128 to Complex) |
Wandelt einen UInt128 Wert explizit in eine komplexe Zahl mit doppelter Genauigkeit um. |
| Implicit(BFloat16 to Complex) |
Stellt eine komplexe Zahl dar. |
| Implicit(Byte to Complex) |
Definiert eine implizite Konvertierung eines nicht signierten Bytes in eine komplexe Zahl. |
| Implicit(Char to Complex) |
Wandelt einen Char Wert implizit in eine komplexe Zahl mit doppelter Genauigkeit um. |
| Implicit(Double to Complex) |
Definiert eine implizite Konvertierung einer Gleitkommazahl mit doppelter Genauigkeit in eine komplexe Zahl. |
| Implicit(Half to Complex) |
Wandelt einen Half Wert implizit in eine komplexe Zahl mit doppelter Genauigkeit um. |
| Implicit(Int16 to Complex) |
Definiert eine implizite Konvertierung einer 16-Bit-ganzzahligen Vorzeichen in eine komplexe Zahl. |
| Implicit(Int32 to Complex) |
Definiert eine implizite Konvertierung einer 32-Bit-ganzzahligen Vorzeichen in eine komplexe Zahl. |
| Implicit(Int64 to Complex) |
Definiert eine implizite Konvertierung einer 64-Bit-ganzzahligen Vorzeichen in eine komplexe Zahl. |
| Implicit(IntPtr to Complex) |
Wandelt einen IntPtr Wert implizit in eine komplexe Zahl mit doppelter Genauigkeit um. |
| Implicit(SByte to Complex) |
Definiert eine implizite Konvertierung eines signierten Bytes in eine komplexe Zahl. Diese API ist nicht CLS-kompatibel. |
| Implicit(Single to Complex) |
Definiert eine implizite Konvertierung einer Gleitkommazahl mit einfacher Genauigkeit in eine komplexe Zahl. |
| Implicit(UInt16 to Complex) |
Definiert eine implizite Konvertierung einer 16-Bit-ganzzahl ohne Vorzeichen in eine komplexe Zahl. Diese API ist nicht CLS-kompatibel. |
| Implicit(UInt32 to Complex) |
Definiert eine implizite Konvertierung einer 32-Bit-ganzzahl ohne Vorzeichen in eine komplexe Zahl. Diese API ist nicht CLS-kompatibel. |
| Implicit(UInt64 to Complex) |
Definiert eine implizite Konvertierung einer 64-Bit-ganzzahl ohne Vorzeichen in eine komplexe Zahl. Diese API ist nicht CLS-kompatibel. |
| Implicit(UIntPtr to Complex) |
Wandelt einen UIntPtr Wert implizit in eine komplexe Zahl mit doppelter Genauigkeit um. |
| Increment(Complex) |
Erhöht einen Wert. |
| Inequality(Complex, Complex) |
Gibt einen Wert zurück, der angibt, ob zwei komplexe Zahlen nicht gleich sind. |
| Multiply(Complex, Complex) |
Multipliziert zwei angegebene komplexe Zahlen. |
| Multiply(Complex, Double) |
Multipliziert die angegebene komplexe Zahl mit einer angegebenen Rezisionszahl mit doppelter Genauigkeit. |
| Multiply(Double, Complex) |
Multipliziert eine angegebene reelle Zahl mit doppelter Genauigkeit mit einer angegebenen komplexen Zahl. |
| Subtraction(Complex, Complex) |
Subtrahiert eine komplexe Zahl von einer anderen komplexen Zahl. |
| Subtraction(Complex, Double) |
Subtrahiert eine reelle Zahl mit doppelter Genauigkeit von einer komplexen Zahl. |
| Subtraction(Double, Complex) |
Subtrahiert eine komplexe Zahl von einer reellen Zahl mit doppelter Genauigkeit. |
| UnaryNegation(Complex) |
Gibt die additive Umkehrung einer angegebenen komplexen Zahl zurück. |
| UnaryPlus(Complex) |
Berechnet das unäre Pluszeichen eines Werts. |
Explizite Schnittstellenimplementierungen
| Name | Beschreibung |
|---|---|
| IAdditiveIdentity<Complex,Complex>.AdditiveIdentity |
Ruft die additive Identität des aktuellen Typs ab. |
| IMultiplicativeIdentity<Complex,Complex>.MultiplicativeIdentity |
Ruft die multiplizierte Identität des aktuellen Typs ab. |
| INumberBase<Complex>.Abs(Complex) |
Berechnet den absoluten Wert. |
| INumberBase<Complex>.IsCanonical(Complex) |
Bestimmt, ob sich ein Wert in seiner kanonischen Darstellung befindet. |
| INumberBase<Complex>.IsZero(Complex) |
Bestimmt, ob ein Wert null ist. |
| INumberBase<Complex>.MaxMagnitudeNumber(Complex, Complex) |
Vergleicht zwei Werte, um zu berechnen, die die größere Größe aufweisen und den anderen Wert zurückgeben, wenn eine Eingabe ist |
| INumberBase<Complex>.MinMagnitudeNumber(Complex, Complex) |
Vergleicht zwei Werte mit der Berechnung, die die geringere Größe aufweist und den anderen Wert zurückgibt, wenn eine Eingabe ist |
| INumberBase<Complex>.MultiplyAddEstimate(Complex, Complex, Complex) |
Berechnet eine Schätzung von ( |
| INumberBase<Complex>.One |
Ruft den Wert |
| INumberBase<Complex>.Radix |
Ruft die Basis für den Typ ab. |
| INumberBase<Complex>.TryConvertFromChecked<TOther>(TOther, Complex) |
Stellt eine komplexe Zahl dar. |
| INumberBase<Complex>.TryConvertFromSaturating<TOther>(TOther, Complex) |
Stellt eine komplexe Zahl dar. |
| INumberBase<Complex>.TryConvertFromTruncating<TOther>(TOther, Complex) |
Stellt eine komplexe Zahl dar. |
| INumberBase<Complex>.TryConvertToChecked<TOther>(Complex, TOther) |
Versucht, eine Instanz des aktuellen Typs in einen anderen Typ zu konvertieren und löst eine Überlaufausnahme für alle Werte aus, die außerhalb des darstellbaren Bereichs des aktuellen Typs liegen. |
| INumberBase<Complex>.TryConvertToSaturating<TOther>(Complex, TOther) |
Versucht, eine Instanz des aktuellen Typs in einen anderen Typ zu konvertieren und alle Werte zu sättigungen, die außerhalb des darstellbaren Bereichs des aktuellen Typs liegen. |
| INumberBase<Complex>.TryConvertToTruncating<TOther>(Complex, TOther) |
Versucht, eine Instanz des aktuellen Typs in einen anderen Typ zu konvertieren, wobei alle Werte abgeschnitten werden, die außerhalb des darstellbaren Bereichs des aktuellen Typs liegen. |
| INumberBase<Complex>.Zero |
Ruft den Wert |
| ISignedNumber<Complex>.NegativeOne |
Ruft den Wert |