shadow:standard@CanAdd<T>, shadow:standard@CanSubtract<T>, shadow:standard@CanMultiply<T>, shadow:standard@CanDivide<T>, shadow:standard@CanModulus<T>, shadow:standard@CanCompare<T>
interface Number<T>
Interface Number<T> specifies methods that any numerical representation should have. Both the Integer<T> and FloatingPoint<T> interfaces have this interface.
| Modifiers | Return Types | Method and Description |
|---|---|---|
public readonly |
(T) |
max(T other)Method that returns the larger of the current object and another object. |
public readonly |
(T) |
min(T other)Method that returns the smaller of the current object and another object. |
public readonly |
(byte) |
toByte()Method to convert the current type to a |
public readonly |
(code) |
toCode()Method to convert the current type to a |
public readonly |
(double) |
toDouble()Method to convert the current type to a |
public readonly |
(float) |
toFloat()Method to convert the current type to a |
public readonly |
(int) |
toInt()Method to convert the current type to an |
public readonly |
(long) |
toLong()Method to convert the current type to a |
public readonly |
(short) |
toShort()Method to convert the current type to a |
public readonly |
(ubyte) |
toUByte()Method to convert the current type to a |
public readonly |
(uint) |
toUInt()Method to convert the current type to a |
public readonly |
(ulong) |
toULong()Method to convert the current type to a |
public readonly |
(ushort) |
toUShort()Method to convert the current type to a |
public readonly max(T other) => (T)
Method that returns the larger of the current object and another object.
other - object to compare with
larger value
public readonly min(T other) => (T)
Method that returns the smaller of the current object and another object.
other - object to compare with
smaller value
public readonly toByte() => (byte)
Method to convert the current type to a byte.
byte value
public readonly toCode() => (code)
Method to convert the current type to a code.
code value
public readonly toDouble() => (double)
Method to convert the current type to a double.
double value
public readonly toFloat() => (float)
Method to convert the current type to a float.
float value
public readonly toInt() => (int)
Method to convert the current type to an int.
int value
public readonly toLong() => (long)
Method to convert the current type to a long.
long value
public readonly toShort() => (short)
Method to convert the current type to a short.
short value
public readonly toUByte() => (ubyte)
Method to convert the current type to a ubyte.
ubyte value
public readonly toUInt() => (uint)
Method to convert the current type to a uint.
uint value
public readonly toULong() => (ulong)
Method to convert the current type to a ulong.
ulong value
public readonly toUShort() => (ushort)
Method to convert the current type to a ushort.
ushort value