7[RequiresPreviewFeatures(
"Generic Math is in preview.", Url =
"https://aka.ms/dotnet-warnings/generic-math-preview")]
8public interface INumber<TSelf> :
IAdditionOperators<TSelf, TSelf, TSelf>,
IAdditiveIdentity<TSelf, TSelf>,
IComparisonOperators<TSelf, TSelf>,
IComparable,
IComparable<TSelf>,
IEqualityOperators<TSelf, TSelf>,
IEquatable<TSelf>,
IDecrementOperators<TSelf>,
IDivisionOperators<TSelf, TSelf, TSelf>,
IIncrementOperators<TSelf>,
IModulusOperators<TSelf, TSelf, TSelf>,
IMultiplicativeIdentity<TSelf, TSelf>,
IMultiplyOperators<TSelf, TSelf, TSelf>,
ISpanFormattable,
IFormattable,
ISpanParseable<TSelf>,
IParseable<TSelf>,
ISubtractionOperators<TSelf, TSelf, TSelf>,
IUnaryNegationOperators<TSelf, TSelf>,
IUnaryPlusOperators<TSelf, TSelf> where TSelf :
INumber<TSelf>
10 static abstract TSelf
One {
get; }
12 static abstract TSelf
Zero {
get; }
16 static abstract TSelf
Clamp(TSelf
value, TSelf min, TSelf max);
24 static abstract (TSelf
Quotient, TSelf Remainder)
DivRem(TSelf left, TSelf right);
26 static abstract TSelf
Max(TSelf x, TSelf y);
28 static abstract TSelf
Min(TSelf x, TSelf y);
static TSelf Max(TSelf x, TSelf y)
static bool TryParse([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, out TSelf result)
static TSelf CreateTruncating< TOther >(TOther value)
static TSelf Create< TOther >(TOther value)
static bool TryParse(ReadOnlySpan< char > s, NumberStyles style, IFormatProvider? provider, out TSelf result)
static TSelf Parse(ReadOnlySpan< char > s, NumberStyles style, IFormatProvider? provider)
static TSelf Parse(string s, NumberStyles style, IFormatProvider? provider)
static TSelf CreateSaturating< TOther >(TOther value)
static TSelf Sign(TSelf value)
static TSelf Min(TSelf x, TSelf y)
static TSelf TSelf Remainder DivRem(TSelf left, TSelf right)
static bool TryCreate< TOther >(TOther value, out TSelf result)
static TSelf Abs(TSelf value)
static TSelf Clamp(TSelf value, TSelf min, TSelf max)