shadow:standard

Interface Number<T>

Interfaces

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.

See Also

Method Summary

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 byte.

public readonly (code) toCode()

Method to convert the current type to a code.

public readonly (double) toDouble()

Method to convert the current type to a double.

public readonly (float) toFloat()

Method to convert the current type to a float.

public readonly (int) toInt()

Method to convert the current type to an int.

public readonly (long) toLong()

Method to convert the current type to a long.

public readonly (short) toShort()

Method to convert the current type to a short.

public readonly (ubyte) toUByte()

Method to convert the current type to a ubyte.

public readonly (uint) toUInt()

Method to convert the current type to a uint.

public readonly (ulong) toULong()

Method to convert the current type to a ulong.

public readonly (ushort) toUShort()

Method to convert the current type to a ushort.

Method Detail

max

public readonly max(T other) => (T)

Method that returns the larger of the current object and another object.

Parameters

other - object to compare with

Returns

larger value

min

public readonly min(T other) => (T)

Method that returns the smaller of the current object and another object.

Parameters

other - object to compare with

Returns

smaller value

toByte

public readonly toByte() => (byte)

Method to convert the current type to a byte.

Returns

byte value

toCode

public readonly toCode() => (code)

Method to convert the current type to a code.

Returns

code value

toDouble

public readonly toDouble() => (double)

Method to convert the current type to a double.

Returns

double value

toFloat

public readonly toFloat() => (float)

Method to convert the current type to a float.

Returns

float value

toInt

public readonly toInt() => (int)

Method to convert the current type to an int.

Returns

int value

toLong

public readonly toLong() => (long)

Method to convert the current type to a long.

Returns

long value

toShort

public readonly toShort() => (short)

Method to convert the current type to a short.

Returns

short value

toUByte

public readonly toUByte() => (ubyte)

Method to convert the current type to a ubyte.

Returns

ubyte value

toUInt

public readonly toUInt() => (uint)

Method to convert the current type to a uint.

Returns

uint value

toULong

public readonly toULong() => (ulong)

Method to convert the current type to a ulong.

Returns

ulong value

toUShort

public readonly toUShort() => (ushort)

Method to convert the current type to a ushort.

Returns

ushort value