Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
INumber.cs
Go to the documentation of this file.
4
5namespace System;
6
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>
9{
10 static abstract TSelf One { get; }
11
12 static abstract TSelf Zero { get; }
13
14 static abstract TSelf Abs(TSelf value);
15
16 static abstract TSelf Clamp(TSelf value, TSelf min, TSelf max);
17
18 static abstract TSelf Create<TOther>(TOther value) where TOther : INumber<TOther>;
19
20 static abstract TSelf CreateSaturating<TOther>(TOther value) where TOther : INumber<TOther>;
21
22 static abstract TSelf CreateTruncating<TOther>(TOther value) where TOther : INumber<TOther>;
23
24 static abstract (TSelf Quotient, TSelf Remainder) DivRem(TSelf left, TSelf right);
25
26 static abstract TSelf Max(TSelf x, TSelf y);
27
28 static abstract TSelf Min(TSelf x, TSelf y);
29
30 static abstract TSelf Parse(string s, NumberStyles style, IFormatProvider? provider);
31
32 static abstract TSelf Parse(ReadOnlySpan<char> s, NumberStyles style, IFormatProvider? provider);
33
34 static abstract TSelf Sign(TSelf value);
35
36 static abstract bool TryCreate<TOther>(TOther value, out TSelf result) where TOther : INumber<TOther>;
37
38 static abstract bool TryParse([NotNullWhen(true)] string? s, NumberStyles style, IFormatProvider? provider, out TSelf result);
39
40 static abstract bool TryParse(ReadOnlySpan<char> s, NumberStyles style, IFormatProvider? provider, out TSelf result);
41}
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 Quotient
Definition INumber.cs:24
static TSelf Min(TSelf x, TSelf y)
static TSelf TSelf Remainder DivRem(TSelf left, TSelf right)
static TSelf One
Definition INumber.cs:10
static bool TryCreate< TOther >(TOther value, out TSelf result)
static TSelf Zero
Definition INumber.cs:12
static TSelf Abs(TSelf value)
static TSelf Clamp(TSelf value, TSelf min, TSelf max)