INumber<TSelf> Интерфейс

Определение

Определяет тип числа.

generic <typename TSelf>
 where TSelf : INumber<TSelf>public interface class INumber : IComparable, IComparable<TSelf>, IEquatable<TSelf>, IParsable<TSelf>, ISpanParsable<TSelf>, System::Numerics::IAdditionOperators<TSelf, TSelf, TSelf>, System::Numerics::IAdditiveIdentity<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::INumberBase<TSelf>, System::Numerics::ISubtractionOperators<TSelf, TSelf, TSelf>, System::Numerics::IUnaryNegationOperators<TSelf, TSelf>, System::Numerics::IUnaryPlusOperators<TSelf, TSelf>
generic <typename TSelf>
 where TSelf : INumber<TSelf>public interface class INumber : IComparable, IComparable<TSelf>, IEquatable<TSelf>, IParsable<TSelf>, ISpanParsable<TSelf>, IUtf8SpanParsable<TSelf>, System::Numerics::IAdditionOperators<TSelf, TSelf, TSelf>, System::Numerics::IAdditiveIdentity<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::INumberBase<TSelf>, System::Numerics::ISubtractionOperators<TSelf, TSelf, TSelf>, System::Numerics::IUnaryNegationOperators<TSelf, TSelf>, System::Numerics::IUnaryPlusOperators<TSelf, TSelf>
public interface INumber<TSelf> : IComparable, IComparable<TSelf>, IEquatable<TSelf>, IParsable<TSelf>, ISpanParsable<TSelf>, System.Numerics.IAdditionOperators<TSelf,TSelf,TSelf>, System.Numerics.IAdditiveIdentity<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.INumberBase<TSelf>, System.Numerics.ISubtractionOperators<TSelf,TSelf,TSelf>, System.Numerics.IUnaryNegationOperators<TSelf,TSelf>, System.Numerics.IUnaryPlusOperators<TSelf,TSelf> where TSelf : INumber<TSelf>
public interface INumber<TSelf> : IComparable, IComparable<TSelf>, IEquatable<TSelf>, IParsable<TSelf>, ISpanParsable<TSelf>, IUtf8SpanParsable<TSelf>, System.Numerics.IAdditionOperators<TSelf,TSelf,TSelf>, System.Numerics.IAdditiveIdentity<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.INumberBase<TSelf>, System.Numerics.ISubtractionOperators<TSelf,TSelf,TSelf>, System.Numerics.IUnaryNegationOperators<TSelf,TSelf>, System.Numerics.IUnaryPlusOperators<TSelf,TSelf> where TSelf : INumber<TSelf>
type INumber<'Self (requires 'Self :> INumber<'Self>)> = interface
    interface IComparable
    interface IComparable<'Self (requires 'Self :> INumber<'Self>)>
    interface IEquatable<'Self (requires 'Self :> INumber<'Self>)>
    interface IFormattable
    interface IParsable<'Self (requires 'Self :> INumber<'Self>)>
    interface ISpanFormattable
    interface ISpanParsable<'Self (requires 'Self :> INumber<'Self>)>
    interface IAdditionOperators<'Self, 'Self, 'Self (requires 'Self :> INumber<'Self> and 'Self :> INumber<'Self> and 'Self :> INumber<'Self>)>
    interface IAdditiveIdentity<'Self, 'Self (requires 'Self :> INumber<'Self> and 'Self :> INumber<'Self>)>
    interface IComparisonOperators<'Self, 'Self, bool (requires 'Self :> INumber<'Self> and 'Self :> INumber<'Self>)>
    interface IEqualityOperators<'Self, 'Self, bool (requires 'Self :> INumber<'Self> and 'Self :> INumber<'Self>)>
    interface IDecrementOperators<'Self (requires 'Self :> INumber<'Self>)>
    interface IDivisionOperators<'Self, 'Self, 'Self (requires 'Self :> INumber<'Self> and 'Self :> INumber<'Self> and 'Self :> INumber<'Self>)>
    interface IIncrementOperators<'Self (requires 'Self :> INumber<'Self>)>
    interface IModulusOperators<'Self, 'Self, 'Self (requires 'Self :> INumber<'Self> and 'Self :> INumber<'Self> and 'Self :> INumber<'Self>)>
    interface IMultiplicativeIdentity<'Self, 'Self (requires 'Self :> INumber<'Self> and 'Self :> INumber<'Self>)>
    interface IMultiplyOperators<'Self, 'Self, 'Self (requires 'Self :> INumber<'Self> and 'Self :> INumber<'Self> and 'Self :> INumber<'Self>)>
    interface INumberBase<'Self (requires 'Self :> INumber<'Self>)>
    interface ISubtractionOperators<'Self, 'Self, 'Self (requires 'Self :> INumber<'Self> and 'Self :> INumber<'Self> and 'Self :> INumber<'Self>)>
    interface IUnaryNegationOperators<'Self, 'Self (requires 'Self :> INumber<'Self> and 'Self :> INumber<'Self>)>
    interface IUnaryPlusOperators<'Self, 'Self (requires 'Self :> INumber<'Self> and 'Self :> INumber<'Self>)>
type INumber<'Self (requires 'Self :> INumber<'Self>)> = interface
    interface IComparable
    interface IComparable<'Self (requires 'Self :> INumber<'Self>)>
    interface IEquatable<'Self (requires 'Self :> INumber<'Self>)>
    interface IFormattable
    interface IParsable<'Self (requires 'Self :> INumber<'Self>)>
    interface ISpanFormattable
    interface ISpanParsable<'Self (requires 'Self :> INumber<'Self>)>
    interface IAdditionOperators<'Self, 'Self, 'Self (requires 'Self :> INumber<'Self> and 'Self :> INumber<'Self> and 'Self :> INumber<'Self>)>
    interface IAdditiveIdentity<'Self, 'Self (requires 'Self :> INumber<'Self> and 'Self :> INumber<'Self>)>
    interface IComparisonOperators<'Self, 'Self, bool (requires 'Self :> INumber<'Self> and 'Self :> INumber<'Self>)>
    interface IEqualityOperators<'Self, 'Self, bool (requires 'Self :> INumber<'Self> and 'Self :> INumber<'Self>)>
    interface IDecrementOperators<'Self (requires 'Self :> INumber<'Self>)>
    interface IDivisionOperators<'Self, 'Self, 'Self (requires 'Self :> INumber<'Self> and 'Self :> INumber<'Self> and 'Self :> INumber<'Self>)>
    interface IIncrementOperators<'Self (requires 'Self :> INumber<'Self>)>
    interface IModulusOperators<'Self, 'Self, 'Self (requires 'Self :> INumber<'Self> and 'Self :> INumber<'Self> and 'Self :> INumber<'Self>)>
    interface IMultiplicativeIdentity<'Self, 'Self (requires 'Self :> INumber<'Self> and 'Self :> INumber<'Self>)>
    interface IMultiplyOperators<'Self, 'Self, 'Self (requires 'Self :> INumber<'Self> and 'Self :> INumber<'Self> and 'Self :> INumber<'Self>)>
    interface INumberBase<'Self (requires 'Self :> INumber<'Self>)>
    interface ISubtractionOperators<'Self, 'Self, 'Self (requires 'Self :> INumber<'Self> and 'Self :> INumber<'Self> and 'Self :> INumber<'Self>)>
    interface IUnaryNegationOperators<'Self, 'Self (requires 'Self :> INumber<'Self> and 'Self :> INumber<'Self>)>
    interface IUnaryPlusOperators<'Self, 'Self (requires 'Self :> INumber<'Self> and 'Self :> INumber<'Self>)>
    interface IUtf8SpanFormattable
    interface IUtf8SpanParsable<'Self (requires 'Self :> INumber<'Self>)>
type INumber<'Self (requires 'Self :> INumber<'Self>)> = interface
    interface IComparable
    interface IComparable<'Self (requires 'Self :> INumber<'Self>)>
    interface IEquatable<'Self (requires 'Self :> INumber<'Self>)>
    interface IFormattable
    interface IParsable<'Self (requires 'Self :> INumber<'Self>)>
    interface ISpanFormattable
    interface ISpanParsable<'Self (requires 'Self :> INumber<'Self>)>
    interface IAdditionOperators<'Self, 'Self, 'Self (requires 'Self :> INumber<'Self> and 'Self :> INumber<'Self> and 'Self :> INumber<'Self>)>
    interface IAdditiveIdentity<'Self, 'Self (requires 'Self :> INumber<'Self> and 'Self :> INumber<'Self>)>
    interface IComparisonOperators<'Self, 'Self, bool (requires 'Self :> INumber<'Self> and 'Self :> INumber<'Self>)>
    interface IEqualityOperators<'Self, 'Self, bool (requires 'Self :> INumber<'Self> and 'Self :> INumber<'Self>)>
    interface IDecrementOperators<'Self (requires 'Self :> INumber<'Self>)>
    interface IDivisionOperators<'Self, 'Self, 'Self (requires 'Self :> INumber<'Self> and 'Self :> INumber<'Self> and 'Self :> INumber<'Self>)>
    interface IIncrementOperators<'Self (requires 'Self :> INumber<'Self>)>
    interface IModulusOperators<'Self, 'Self, 'Self (requires 'Self :> INumber<'Self> and 'Self :> INumber<'Self> and 'Self :> INumber<'Self>)>
    interface IMultiplicativeIdentity<'Self, 'Self (requires 'Self :> INumber<'Self> and 'Self :> INumber<'Self>)>
    interface IMultiplyOperators<'Self, 'Self, 'Self (requires 'Self :> INumber<'Self> and 'Self :> INumber<'Self> and 'Self :> INumber<'Self>)>
    interface INumberBase<'Self (requires 'Self :> INumber<'Self>)>
    interface IUtf8SpanFormattable
    interface IUtf8SpanParsable<'Self (requires 'Self :> INumber<'Self>)>
    interface ISubtractionOperators<'Self, 'Self, 'Self (requires 'Self :> INumber<'Self> and 'Self :> INumber<'Self> and 'Self :> INumber<'Self>)>
    interface IUnaryNegationOperators<'Self, 'Self (requires 'Self :> INumber<'Self> and 'Self :> INumber<'Self>)>
    interface IUnaryPlusOperators<'Self, 'Self (requires 'Self :> INumber<'Self> and 'Self :> INumber<'Self>)>
Public Interface INumber(Of TSelf)
Implements IAdditionOperators(Of TSelf, TSelf, TSelf), IAdditiveIdentity(Of TSelf, TSelf), IComparable, IComparable(Of TSelf), IComparisonOperators(Of TSelf, TSelf, Boolean), IDecrementOperators(Of TSelf), IDivisionOperators(Of TSelf, TSelf, TSelf), IEqualityOperators(Of TSelf, TSelf, Boolean), IEquatable(Of TSelf), IIncrementOperators(Of TSelf), IModulusOperators(Of TSelf, TSelf, TSelf), IMultiplicativeIdentity(Of TSelf, TSelf), IMultiplyOperators(Of TSelf, TSelf, TSelf), INumberBase(Of TSelf), IParsable(Of TSelf), ISpanParsable(Of TSelf), ISubtractionOperators(Of TSelf, TSelf, TSelf), IUnaryNegationOperators(Of TSelf, TSelf), IUnaryPlusOperators(Of TSelf, TSelf)
Public Interface INumber(Of TSelf)
Implements IAdditionOperators(Of TSelf, TSelf, TSelf), IAdditiveIdentity(Of TSelf, TSelf), IComparable, IComparable(Of TSelf), IComparisonOperators(Of TSelf, TSelf, Boolean), IDecrementOperators(Of TSelf), IDivisionOperators(Of TSelf, TSelf, TSelf), IEqualityOperators(Of TSelf, TSelf, Boolean), IEquatable(Of TSelf), IIncrementOperators(Of TSelf), IModulusOperators(Of TSelf, TSelf, TSelf), IMultiplicativeIdentity(Of TSelf, TSelf), IMultiplyOperators(Of TSelf, TSelf, TSelf), INumberBase(Of TSelf), IParsable(Of TSelf), ISpanParsable(Of TSelf), ISubtractionOperators(Of TSelf, TSelf, TSelf), IUnaryNegationOperators(Of TSelf, TSelf), IUnaryPlusOperators(Of TSelf, TSelf), IUtf8SpanParsable(Of TSelf)

Параметры типа

TSelf

Тип, реализующий интерфейс .

Производный
Реализации

Методы

Clamp(TSelf, TSelf, TSelf)

Зажимает значение до минимального и максимального значений включительно.

CompareTo(Object)

Сравнивает текущий экземпляр с другим объектом того же типа и возвращает целое число, которое показывает, расположен ли текущий экземпляр перед, после или на той же позиции в порядке сортировки, что и другой объект.

(Унаследовано от IComparable)
CompareTo(T)

Сравнивает текущий экземпляр с другим объектом того же типа и возвращает целое число, которое показывает, расположен ли текущий экземпляр перед, после или на той же позиции в порядке сортировки, что и другой объект.

(Унаследовано от IComparable<T>)
CopySign(TSelf, TSelf)

Копирует знак значения в знак другого значения.

Equals(T)

Указывает, равен ли текущий объект другому объекту того же типа.

(Унаследовано от IEquatable<T>)
Max(TSelf, TSelf)

Сравнивает два значения, чтобы вычислить большее значение.

MaxNumber(TSelf, TSelf)

Сравнивает два значения для вычисления, которое больше, и возвращает другое значение, если входные данные имеют значение NaN.

Min(TSelf, TSelf)

Сравнивает два значения для вычисления меньшего значения.

MinNumber(TSelf, TSelf)

Сравнивает два значения для вычисления меньшего значения и возвращает другое значение, если входные данные имеют значение NaN.

Sign(TSelf)

Вычисляет знак значения.

ToString(String, IFormatProvider)

Форматирует значение текущего экземпляра, используя указанный формат.

(Унаследовано от IFormattable)
TryFormat(Span<Byte>, Int32, ReadOnlySpan<Char>, IFormatProvider)

Пытается отформатировать значение текущего экземпляра как UTF-8 в предоставленный диапазон байтов.

(Унаследовано от IUtf8SpanFormattable)
TryFormat(Span<Char>, Int32, ReadOnlySpan<Char>, IFormatProvider)

Пытается отформатировать значение текущего экземпляра в указанный диапазон символов.

(Унаследовано от ISpanFormattable)

Явные реализации интерфейса

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

Определяет тип числа.

(Унаследовано от INumberBase<TSelf>)
IUtf8SpanParsable<TSelf>.Parse(ReadOnlySpan<Byte>, IFormatProvider)

Анализирует диапазон символов UTF-8 в значение.

(Унаследовано от INumberBase<TSelf>)
IUtf8SpanParsable<TSelf>.TryParse(ReadOnlySpan<Byte>, IFormatProvider, TSelf)

Пытается проанализировать диапазон символов UTF-8 в значение.

(Унаследовано от INumberBase<TSelf>)

Применяется к