Enhanced C#
Language of your choice: library documentation
|
This interface provides information about a numeric type T. More...
This interface provides information about a numeric type T.
T | A numeric type |
Properties | |
T | MinValue [get] |
Minimum value of this type above negative infinity. More... | |
T | MaxValue [get] |
Maximum value of this type below infinity. More... | |
T | Epsilon [get] |
Smallest representable positive value of T (1 for integer types). More... | |
T | PositiveInfinity [get] |
Returns positive infinity, or MaxValue for types that cannot represent infinity. More... | |
T | NegativeInfinity [get] |
Returns negative infinity, or throws NotSupportedException if T is unsigned. More... | |
T | NaN [get] |
Not-a-number or null representation for this type. More... | |
bool | IsSigned [get] |
Returns true if T can represent negative values. More... | |
bool | IsFloatingPoint [get] |
Returns true if T is floating-point, meaning that it can represent very large and very small numbers, despite possibly limited precision. Returns false for fixed-point and integer-rational types. More... | |
bool | IsInteger [get] |
Returns true if the type represents only whole numbers. More... | |
bool | IsOrdered [get] |
Returns true for "normal" numbers, false for ones that aren't necessarily comparable (notably complex numbers). More... | |
int | SignificantBits [get] |
Returns the normal maximum number of significant (mantissa) bits for this type (not counting the sign bit), or int.MaxValue for unlimited-size types. More... | |
int | MaxIntPowerOf2 [get] |
Returns the maximum power-of-two-minus-one that can be represented by this type, e.g. for Int32 it's 31, and for UInt32 it's 32. More... | |
ulong | MaxInt [get] |
Returns the maximum integer that this type can represent. More... | |
long | MinInt [get] |
Returns the minimum integer that this type can represent. More... | |
Properties inherited from Loyc.Math.IZeroProvider< T > | |
T | Zero [get] |
Returns the "zero" or additive identity of this type. More... | |
Properties inherited from Loyc.Math.IOneProvider< T > | |
T | One [get] |
Returns the "one" or identity value of this type. More... | |
Public Member Functions | |
bool | IsInfinity (T value) |
Returns true if the given value is infinite. More... | |
bool | IsNaN (T value) |
Returns true if the given value is not a number (can only be true for floats). More... | |
T | Floor (T value) |
Gets the closest integer equal to or lower than the specified number. More... | |
T | Ceiling (T value) |
Gets the closest integer equal to or higher than the specified number. More... | |
T Loyc.Math.INumTraits< T >.Ceiling | ( | T | value | ) |
Gets the closest integer equal to or higher than the specified number.
For integer types, this has no effect.
Implemented in Loyc.Math.MathFL32, Loyc.Math.MathFL16, Loyc.Math.MathF23, Loyc.Math.MathF16, Loyc.Math.MathF8, Loyc.Math.MathD, Loyc.Math.MathF, Loyc.Math.MathUL, Loyc.Math.MathL, Loyc.Math.MathU, Loyc.Math.MathI, Loyc.Math.MathU16, Loyc.Math.MathI16, Loyc.Math.MathU8, and Loyc.Math.MathI8.
T Loyc.Math.INumTraits< T >.Floor | ( | T | value | ) |
Gets the closest integer equal to or lower than the specified number.
For integer types, this has no effect.
Implemented in Loyc.Math.MathFL32, Loyc.Math.MathFL16, Loyc.Math.MathF23, Loyc.Math.MathF16, Loyc.Math.MathF8, Loyc.Math.MathD, Loyc.Math.MathF, Loyc.Math.MathUL, Loyc.Math.MathL, Loyc.Math.MathU, Loyc.Math.MathI, Loyc.Math.MathU16, Loyc.Math.MathI16, Loyc.Math.MathU8, and Loyc.Math.MathI8.
bool Loyc.Math.INumTraits< T >.IsInfinity | ( | T | value | ) |
Returns true if the given value is infinite.
Types that do not have an infinity value always return false from this method.
Implemented in Loyc.Math.MathFL32, Loyc.Math.MathFL16, Loyc.Math.MathF23, Loyc.Math.MathF16, Loyc.Math.MathF8, Loyc.Math.MathD, Loyc.Math.MathF, Loyc.Math.MathUL, Loyc.Math.MathL, Loyc.Math.MathU, Loyc.Math.MathI, Loyc.Math.MathU16, Loyc.Math.MathI16, Loyc.Math.MathU8, and Loyc.Math.MathI8.
bool Loyc.Math.INumTraits< T >.IsNaN | ( | T | value | ) |
Returns true if the given value is not a number (can only be true for floats).
Implemented in Loyc.Math.MathFL32, Loyc.Math.MathFL16, Loyc.Math.MathF23, Loyc.Math.MathF16, Loyc.Math.MathF8, Loyc.Math.MathD, Loyc.Math.MathF, Loyc.Math.MathUL, Loyc.Math.MathL, Loyc.Math.MathU, Loyc.Math.MathI, Loyc.Math.MathU16, Loyc.Math.MathI16, Loyc.Math.MathU8, and Loyc.Math.MathI8.
|
get |
Smallest representable positive value of T (1 for integer types).
|
get |
Returns true if T is floating-point, meaning that it can represent very large and very small numbers, despite possibly limited precision. Returns false for fixed-point and integer-rational types.
|
get |
Returns true if the type represents only whole numbers.
|
get |
Returns true for "normal" numbers, false for ones that aren't necessarily comparable (notably complex numbers).
|
get |
Returns true if T can represent negative values.
|
get |
Returns the maximum integer that this type can represent.
If the maximum integer exceeds ulong.MaxValue, this returns ulong.MaxValue.
|
get |
Returns the maximum power-of-two-minus-one that can be represented by this type, e.g. for Int32 it's 31, and for UInt32 it's 32.
|
get |
Maximum value of this type below infinity.
|
get |
Returns the minimum integer that this type can represent.
If the minimum is less than long.MinValue, this returns long.MinValue.
|
get |
Minimum value of this type above negative infinity.
|
get |
Not-a-number or null representation for this type.
NotSupportedException | There is no null or NaN value for type T. |
|
get |
Returns negative infinity, or throws NotSupportedException if T is unsigned.
NotSupportedException | T is unsigned. |
|
get |
Returns positive infinity, or MaxValue for types that cannot represent infinity.
|
get |
Returns the normal maximum number of significant (mantissa) bits for this type (not counting the sign bit), or int.MaxValue for unlimited-size types.