The number to calculate the absolute value of.
The absolute value of the number.
abs(-5); // Returns 5
Returns the absolute value of a bigint.
The bigint to calculate the absolute value of.
The absolute value of the bigint.
abs(-5n); // Returns 5n
Returns the absolute value of a number of type T.
The number to calculate the absolute value of.
Optional
numerical: Numerical<T>An instance of Numerical
The absolute value of the number of type T.
T - The data type for the numeric operations.
If x's type is neither number nor bigint, and no Numerical
abs(-5); // Returns 5
abs(-5n); // Returns 5n
abs(-5, new Numerical<number>()); // Where Numerical<number>() is an implementation for numbers.
Generated using TypeDoc
Returns the absolute value of a number.