Auf Englisch lesen

Teilen über


IBinaryNumber<TSelf> Schnittstelle

Definition

Definiert eine Zahl, die in einem Basis-2-Format dargestellt wird.

C#
public interface IBinaryNumber<TSelf> : IComparable<TSelf>, IEquatable<TSelf>, IParsable<TSelf>, ISpanParsable<TSelf>, IUtf8SpanParsable<TSelf>, System.Numerics.IAdditionOperators<TSelf,TSelf,TSelf>, System.Numerics.IAdditiveIdentity<TSelf,TSelf>, System.Numerics.IBitwiseOperators<TSelf,TSelf,TSelf>, System.Numerics.IComparisonOperators<TSelf,TSelf,bool>, System.Numerics.IDecrementOperators<TSelf>, System.Numerics.IDivisionOperators<TSelf,TSelf,TSelf>, System.Numerics.IEqualityOperators<TSelf,TSelf,bool>, System.Numerics.IIncrementOperators<TSelf>, System.Numerics.IModulusOperators<TSelf,TSelf,TSelf>, System.Numerics.IMultiplicativeIdentity<TSelf,TSelf>, System.Numerics.IMultiplyOperators<TSelf,TSelf,TSelf>, System.Numerics.INumber<TSelf>, System.Numerics.INumberBase<TSelf>, System.Numerics.ISubtractionOperators<TSelf,TSelf,TSelf>, System.Numerics.IUnaryNegationOperators<TSelf,TSelf>, System.Numerics.IUnaryPlusOperators<TSelf,TSelf> where TSelf : IBinaryNumber<TSelf>
C#
public interface IBinaryNumber<TSelf> : IComparable<TSelf>, IEquatable<TSelf>, IParsable<TSelf>, ISpanParsable<TSelf>, System.Numerics.IAdditionOperators<TSelf,TSelf,TSelf>, System.Numerics.IAdditiveIdentity<TSelf,TSelf>, System.Numerics.IBitwiseOperators<TSelf,TSelf,TSelf>, System.Numerics.IComparisonOperators<TSelf,TSelf,bool>, System.Numerics.IDecrementOperators<TSelf>, System.Numerics.IDivisionOperators<TSelf,TSelf,TSelf>, System.Numerics.IEqualityOperators<TSelf,TSelf,bool>, System.Numerics.IIncrementOperators<TSelf>, System.Numerics.IModulusOperators<TSelf,TSelf,TSelf>, System.Numerics.IMultiplicativeIdentity<TSelf,TSelf>, System.Numerics.IMultiplyOperators<TSelf,TSelf,TSelf>, System.Numerics.INumber<TSelf>, System.Numerics.INumberBase<TSelf>, System.Numerics.ISubtractionOperators<TSelf,TSelf,TSelf>, System.Numerics.IUnaryNegationOperators<TSelf,TSelf>, System.Numerics.IUnaryPlusOperators<TSelf,TSelf> where TSelf : IBinaryNumber<TSelf>

Typparameter

TSelf

Der Typ, der die Schnittstelle implementiert.

Abgeleitet
Implementiert

Eigenschaften

AllBitsSet

Ruft eine Instanz des binären Typs ab, in der alle Bits festgelegt sind.

Methoden

CompareTo(Object)

Vergleicht die aktuelle Instanz mit einem anderen Objekt desselben Typs und gibt eine ganze Zahl zurück, die angibt, ob die aktuelle Instanz vorgeht, folgt oder in derselben Position in der Sortierreihenfolge wie das andere Objekt auftritt.

(Geerbt von IComparable)
CompareTo(T)

Vergleicht die aktuelle Instanz mit einem anderen Objekt desselben Typs und gibt eine ganze Zahl zurück, die angibt, ob die aktuelle Instanz vorgeht, folgt oder in derselben Position in der Sortierreihenfolge wie das andere Objekt auftritt.

(Geerbt von IComparable<T>)
Equals(T)

Gibt an, ob das aktuelle Objekt einem anderen Objekt desselben Typs entspricht.

(Geerbt von IEquatable<T>)
IsPow2(TSelf)

Bestimmt, ob ein Wert eine Potenz von zwei ist.

Log2(TSelf)

Berechnet das Protokoll2 eines Werts.

ToString(String, IFormatProvider)

Formatiert den Wert der aktuellen Instanz mithilfe des angegebenen Formats.

(Geerbt von IFormattable)
TryFormat(Span<Byte>, Int32, ReadOnlySpan<Char>, IFormatProvider)

Versucht, den Wert der aktuellen Instanz als UTF-8 in die bereitgestellte Bytespanne zu formatieren.

(Geerbt von IUtf8SpanFormattable)
TryFormat(Span<Char>, Int32, ReadOnlySpan<Char>, IFormatProvider)

Versucht, den Wert der aktuellen Instanz in die bereitgestellte Zeichenspanne zu formatieren.

(Geerbt von ISpanFormattable)

Explizite Schnittstellenimplementierungen

IUtf8SpanFormattable.TryFormat(Span<Byte>, Int32, ReadOnlySpan<Char>, IFormatProvider)

Versucht, den Wert der aktuellen Instanz als UTF-8 in die bereitgestellte Bytespanne zu formatieren.

(Geerbt von INumberBase<TSelf>)
IUtf8SpanParsable<TSelf>.Parse(ReadOnlySpan<Byte>, IFormatProvider)

Analysiert eine Spanne von UTF-8 Zeichen in einen Wert.

(Geerbt von INumberBase<TSelf>)
IUtf8SpanParsable<TSelf>.TryParse(ReadOnlySpan<Byte>, IFormatProvider, TSelf)

Versucht, eine Spanne von UTF-8 Zeichen in einen Wert zu analysieren.

(Geerbt von INumberBase<TSelf>)

Gilt für:

Produkt Versionen
.NET 7, 8, 9, 10