Numeric
Index
Interfaces
Add
Type parameters
- Left
- Right = Left
- Output = Left
+
- type T = ...;const TNumeric: Numeric.Add<T> = ...;const result = TNumeric['+'](left, right);// represents (left + right)
CheckedAdd
Type parameters
- Left
- Right = Left
- Output = Left
+?
Addition operator that returns
Noneinstead of wrapping around on overflow.type T = ...;const TNumeric: Numeric.CheckedAdd<T> = ...;const result = TNumeric['+?'](left, right);// represents (left + right)
CheckedDivide
Type parameters
- Base
- Divider = Base
- Output = Base
/?
Division operator
type T = ...;const TNumeric: Numeric.CheckedDivide<T> = ...;const result = Numeric['/?'](left, right);// represents (left / right)
CheckedMultiply
Type parameters
- Base
- Multiplier = Base
- Output = Base
*?
Multiplication operator that returns
Noneinstead of wrapping around on overflow.type T = ...;const TNumeric: Numeric.CheckedMultiply<T> = ...;const result = Numeric['*?'](left, right);// represents (left * right)
CheckedPower
Type parameters
- Left
- Right = Left
- Output = Left
**?
Power operator that returns
Noneinstead of wrapping around on overflow.type T = ...;const TNumeric: Numeric.CheckedPower<T> = ...;const result = TNumeric['**?'](left, right);// represents (left ** right)
CheckedRemainder
Type parameters
- Base
- Divider = Base
- Output = Base
%?
Remainder operator
type T = ...;const TNumeric: Numeric.CheckedRemainder<T> = ...;const result = Numeric['%?'](left, right);// represents (left % right)
CheckedSubtract
Type parameters
- Left
- Right = Left
- Output = Left
-?
Subtraction operator that returns
Noneinstead of wrapping around on overflow.type T = ...;const TNumeric: Numeric.CheckedSubtract<T> = ...;const result = TNumeric['-?'](left, right);// represents (left - right)
Divide
Type parameters
- Base
- Divider = Base
- Output = Base
/
Division operator
type T = ...;const TNumeric: Numeric.Divide<T> = ...;const result = Numeric['/'](left, right);// represents (left / right)
Integral
Integral type
Type parameters
- T
constructor
inherited-
Subtraction operator
type T = ...;const TNumeric: Numeric.Subtract<T> = ...;const result = Numeric['-'](left, right);// represents (left - right)
inherited*
Multiplication operator
type T = ...;const TNumeric: Numeric.Multiply<T> = ...;const result = Numeric['*'](left, right);// represents (left * right)
inherited/
Division operator
type T = ...;const TNumeric: Numeric.Divide<T> = ...;const result = Numeric['/'](left, right);// represents (left / right)
/%
Quotient/Modulo operator
type T = ...;const TNumeric: Numeric.Integral<T> = ...;const result = Numeric['/%'](left, right);// represents [ left / right, left % right ]
inherited%
Remainder operator
type T = ...;const TNumeric: Numeric.Remainder<T> = ...;const result = Numeric['%'](left, right);// represents (left % right)
inherited+
Addition operator
type T = ...;const TNumeric: Numeric.Add<T> = ...;const result = TNumeric['+'](left, right);// represents (left + right)
inheritedabs
Absolute value. It should satisfy
Numeric['*'](Numeric.abs(x), Numeric.sign(x)) == xtype T = ...;const TSigned: Numeric.Signed<T> = ...;const result = TSigned.abs(value);// absolute value of (value)
inheritedasInt
Converts the given value to a Int.
const SomeType: AsInt<T>;const value: T;SomeType.asInt(value); // Int(...)
inheritedfromInt
inheritedisNegative
Returns true if the number is negative and false if the number is zero or positive.
Number.isPositive(-1);// trueNumber.isPositive(0);// falseNumber.isPositive(1);// false
inheritedisOne
Returns true if self is equal to the multiplicative identity.
Number.isOne(1); // trueNumber.isOne(0); // false
inheritedisPositive
Returns true if the number is positive and false if the number is zero or negative.
Number.isPositive(-1);// falseNumber.isPositive(0);// falseNumber.isPositive(1);// true
inheritedisZero
Returns true if self is equal to the additive identity.
Number.isZero(0); // trueNumber.isZero(1); // false
inheritednegate
Negates the given value.
Number.negate(5); // -5Number.negate(Number.negate(5)); // 5
inheritedone
Returns the additive identity element of
T, 0.Number.one(); // 1
inheritedsign
Sign of a number. It should satisfy
TSigned['*'](TSigned.abs(x), TSigned.sign(x)) == xNumber.sign(-2.5);// -1Number.sign(0);// 0Number.sign(2.5);// 1
inheritedzero
Returns the additive identity element of
T, 0.Number.zero(); // 0
IntegralParameters
Type parameters
- T
inheritedcompare
optionalinherited-
Subtraction operator
type T = ...;const TNumeric: Numeric.Subtract<T> = ...;const result = Numeric['-'](left, right);// represents (left - right)
inherited*
Multiplication operator
type T = ...;const TNumeric: Numeric.Multiply<T> = ...;const result = Numeric['*'](left, right);// represents (left * right)
inherited/
Division operator
type T = ...;const TNumeric: Numeric.Divide<T> = ...;const result = Numeric['/'](left, right);// represents (left / right)
inherited%
Remainder operator
type T = ...;const TNumeric: Numeric.Remainder<T> = ...;const result = Numeric['%'](left, right);// represents (left % right)
inherited+
Addition operator
type T = ...;const TNumeric: Numeric.Add<T> = ...;const result = TNumeric['+'](left, right);// represents (left + right)
optionalinheritedabs
Absolute value. It should satisfy
Numeric['*'](Numeric.abs(x), Numeric.sign(x)) == xtype T = ...;const TSigned: Numeric.Signed<T> = ...;const result = TSigned.abs(value);// absolute value of (value)
inheritedasInt
Converts the given value to a Int.
const SomeType: AsInt<T>;const value: T;SomeType.asInt(value); // Int(...)
inheritedfromInt
optionalinheritedisNegative
Returns true if the number is negative and false if the number is zero or positive.
Number.isPositive(-1);// trueNumber.isPositive(0);// falseNumber.isPositive(1);// false
optionalinheritedisOne
Returns true if self is equal to the multiplicative identity.
Number.isOne(1); // trueNumber.isOne(0); // false
optionalinheritedisPositive
Returns true if the number is positive and false if the number is zero or negative.
Number.isPositive(-1);// falseNumber.isPositive(0);// falseNumber.isPositive(1);// true
optionalinheritedisZero
Returns true if self is equal to the additive identity.
Number.isZero(0); // trueNumber.isZero(1); // false
optionalinheritednegate
Negates the given value.
Number.negate(5); // -5Number.negate(Number.negate(5)); // 5
optionalinheritedone
Returns the additive identity element of
T, 0.Number.one(); // 1
optionalinheritedsign
Sign of a number. It should satisfy
TSigned['*'](TSigned.abs(x), TSigned.sign(x)) == xNumber.sign(-2.5);// -1Number.sign(0);// 0Number.sign(2.5);// 1
optionalinheritedzero
Returns the additive identity element of
T, 0.Number.zero(); // 0
Multiply
Type parameters
- Left
- Right = Left
- Output = Left
*
Multiplication operator
type T = ...;const TNumeric: Numeric.Multiply<T> = ...;const result = Numeric['*'](left, right);// represents (left * right)
Negate
Type parameters
- Self
- Output = Self
negate
Negates the given value.
Number.negate(5); // -5Number.negate(Number.negate(5)); // 5
Numeric
Type parameters
- T
constructor
inherited-
Subtraction operator
type T = ...;const TNumeric: Numeric.Subtract<T> = ...;const result = Numeric['-'](left, right);// represents (left - right)
inherited*
Multiplication operator
type T = ...;const TNumeric: Numeric.Multiply<T> = ...;const result = Numeric['*'](left, right);// represents (left * right)
inherited+
Addition operator
type T = ...;const TNumeric: Numeric.Add<T> = ...;const result = TNumeric['+'](left, right);// represents (left + right)
inheritedabs
Absolute value. It should satisfy
Numeric['*'](Numeric.abs(x), Numeric.sign(x)) == xtype T = ...;const TSigned: Numeric.Signed<T> = ...;const result = TSigned.abs(value);// absolute value of (value)
inheritedasInt
Converts the given value to a Int.
const SomeType: AsInt<T>;const value: T;SomeType.asInt(value); // Int(...)
fromInt
inheritedisNegative
Returns true if the number is negative and false if the number is zero or positive.
Number.isPositive(-1);// trueNumber.isPositive(0);// falseNumber.isPositive(1);// false
inheritedisOne
Returns true if self is equal to the multiplicative identity.
Number.isOne(1); // trueNumber.isOne(0); // false
inheritedisPositive
Returns true if the number is positive and false if the number is zero or negative.
Number.isPositive(-1);// falseNumber.isPositive(0);// falseNumber.isPositive(1);// true
inheritedisZero
Returns true if self is equal to the additive identity.
Number.isZero(0); // trueNumber.isZero(1); // false
inheritednegate
Negates the given value.
Number.negate(5); // -5Number.negate(Number.negate(5)); // 5
inheritedone
Returns the additive identity element of
T, 0.Number.one(); // 1
inheritedsign
Sign of a number. It should satisfy
TSigned['*'](TSigned.abs(x), TSigned.sign(x)) == xNumber.sign(-2.5);// -1Number.sign(0);// 0Number.sign(2.5);// 1
inheritedzero
Returns the additive identity element of
T, 0.Number.zero(); // 0
NumericParameters
Type parameters
- T
inheritedcompare
optionalinherited-
Subtraction operator
type T = ...;const TNumeric: Numeric.Subtract<T> = ...;const result = Numeric['-'](left, right);// represents (left - right)
inherited*
Multiplication operator
type T = ...;const TNumeric: Numeric.Multiply<T> = ...;const result = Numeric['*'](left, right);// represents (left * right)
inherited+
Addition operator
type T = ...;const TNumeric: Numeric.Add<T> = ...;const result = TNumeric['+'](left, right);// represents (left + right)
optionalinheritedabs
Absolute value. It should satisfy
Numeric['*'](Numeric.abs(x), Numeric.sign(x)) == xtype T = ...;const TSigned: Numeric.Signed<T> = ...;const result = TSigned.abs(value);// absolute value of (value)
inheritedasInt
Converts the given value to a Int.
const SomeType: AsInt<T>;const value: T;SomeType.asInt(value); // Int(...)
inheritedfromInt
optionalinheritedisNegative
Returns true if the number is negative and false if the number is zero or positive.
Number.isPositive(-1);// trueNumber.isPositive(0);// falseNumber.isPositive(1);// false
optionalinheritedisOne
Returns true if self is equal to the multiplicative identity.
Number.isOne(1); // trueNumber.isOne(0); // false
optionalinheritedisPositive
Returns true if the number is positive and false if the number is zero or negative.
Number.isPositive(-1);// falseNumber.isPositive(0);// falseNumber.isPositive(1);// true
optionalinheritedisZero
Returns true if self is equal to the additive identity.
Number.isZero(0); // trueNumber.isZero(1); // false
optionalinheritednegate
Negates the given value.
Number.negate(5); // -5Number.negate(Number.negate(5)); // 5
optionalinheritedone
Returns the additive identity element of
T, 0.Number.one(); // 1
optionalinheritedsign
Sign of a number. It should satisfy
TSigned['*'](TSigned.abs(x), TSigned.sign(x)) == xNumber.sign(-2.5);// -1Number.sign(0);// 0Number.sign(2.5);// 1
optionalinheritedzero
Returns the additive identity element of
T, 0.Number.zero(); // 0
One
Type parameters
- T
isOne
Returns true if self is equal to the multiplicative identity.
Number.isOne(1); // trueNumber.isOne(0); // false
one
Returns the additive identity element of
T, 0.Number.one(); // 1
Power
Type parameters
- Left
- Right = Left
- Output = Left
**
Power operator
type T = ...;const TNumeric: Numeric.Power<T> = ...;const result = Numeric['**'](left, right);// represents (left ** right)
Remainder
Type parameters
- Base
- Divider = Base
- Output = Base
%
Remainder operator
type T = ...;const TNumeric: Numeric.Remainder<T> = ...;const result = Numeric['%'](left, right);// represents (left % right)
Signed
Type parameters
- T
abs
Absolute value. It should satisfy
Numeric['*'](Numeric.abs(x), Numeric.sign(x)) == xtype T = ...;const TSigned: Numeric.Signed<T> = ...;const result = TSigned.abs(value);// absolute value of (value)
isNegative
Returns true if the number is negative and false if the number is zero or positive.
Number.isPositive(-1);// trueNumber.isPositive(0);// falseNumber.isPositive(1);// false
isPositive
Returns true if the number is positive and false if the number is zero or negative.
Number.isPositive(-1);// falseNumber.isPositive(0);// falseNumber.isPositive(1);// true
sign
Sign of a number. It should satisfy
TSigned['*'](TSigned.abs(x), TSigned.sign(x)) == xNumber.sign(-2.5);// -1Number.sign(0);// 0Number.sign(2.5);// 1
Subtract
Type parameters
- Left
- Right = Left
- Output = Left
-
Subtraction operator
type T = ...;const TNumeric: Numeric.Subtract<T> = ...;const result = Numeric['-'](left, right);// represents (left - right)
Zero
Type parameters
- T
isZero
Returns true if self is equal to the additive identity.
Number.isZero(0); // trueNumber.isZero(1); // false
zero
Returns the additive identity element of
T, 0.Number.zero(); // 0
Addition operator