Methods
(static) abs(num) → {number}
Returns the absolute value of a number.
Parameters:
| Name | Type | Description |
|---|---|---|
num |
number | The number to calculate the absolute value for. |
Returns:
The absolute value of the given number.
- Type
- number
(static) acos(num) → {number}
Returns the arc cosine of a number in radians.
Parameters:
| Name | Type | Description |
|---|---|---|
num |
number | The number to calculate the arc cosine for. |
Returns:
The arc cosine in radians.
- Type
- number
(static) acosh(num) → {number}
Returns the inverse hyperbolic cosine of a number.
Parameters:
| Name | Type | Description |
|---|---|---|
num |
number | The number to calculate the inverse hyperbolic cosine for. |
Returns:
The inverse hyperbolic cosine.
- Type
- number
(static) asin(num) → {number}
Returns the arc sine of a number in radians.
Parameters:
| Name | Type | Description |
|---|---|---|
num |
number | The number to calculate the arc sine for. |
Returns:
The arc sine in radians.
- Type
- number
(static) asinh(num) → {number}
Returns the inverse hyperbolic sine of a number.
Parameters:
| Name | Type | Description |
|---|---|---|
num |
number | The number to calculate the inverse hyperbolic sine for. |
Returns:
The inverse hyperbolic sine.
- Type
- number
(static) atan(num) → {number}
Returns the arc tangent of a number in radians.
Parameters:
| Name | Type | Description |
|---|---|---|
num |
number | The number to calculate the arc tangent for. |
Returns:
The arc tangent in radians.
- Type
- number
(static) atan2(y, x) → {number}
Returns the angle (in radians) from the X-axis to a point (y, x).
Parameters:
| Name | Type | Description |
|---|---|---|
y |
number | The Y-coordinate of the point. |
x |
number | The X-coordinate of the point. |
Returns:
The arc tangent of y/x in radians.
- Type
- number
(static) atanh(num) → {number}
Returns the inverse hyperbolic tangent of a number.
Parameters:
| Name | Type | Description |
|---|---|---|
num |
number | The number to calculate the inverse hyperbolic tangent for. |
Returns:
The inverse hyperbolic tangent.
- Type
- number
(static) base_convert(num, fromBase, toBase) → {string}
Converts a number between arbitrary bases.
Parameters:
| Name | Type | Description |
|---|---|---|
num |
string | The number to convert as a string. |
fromBase |
number | The base of the number to convert from. |
toBase |
number | The base to convert the number to. |
Returns:
The converted number as a string.
- Type
- string
(static) bindec(binaryStr) → {number}
Converts a binary number to its decimal equivalent.
Parameters:
| Name | Type | Description |
|---|---|---|
binaryStr |
string | The binary number as a string. |
Returns:
The decimal equivalent of the binary number.
- Type
- number
(static) ceil(num) → {number}
Rounds fractions up to the nearest integer.
Parameters:
| Name | Type | Description |
|---|---|---|
num |
number | The number to round up. |
Returns:
The rounded-up integer.
- Type
- number
(static) cos(num) → {number}
Returns the cosine of a number.
Parameters:
| Name | Type | Description |
|---|---|---|
num |
number | The number to calculate the cosine for. |
Returns:
The cosine of the number.
- Type
- number
(static) cosh(num) → {number}
Returns the hyperbolic cosine of a number.
Parameters:
| Name | Type | Description |
|---|---|---|
num |
number | The number to calculate the hyperbolic cosine for. |
Returns:
The hyperbolic cosine.
- Type
- number
(static) decbin(decimalNum) → {string}
Converts a decimal number to its binary equivalent.
Parameters:
| Name | Type | Description |
|---|---|---|
decimalNum |
number | The decimal number to convert. |
Returns:
The binary representation of the decimal number.
- Type
- string
(static) dechex(decimalNum) → {string}
Converts a decimal number to its hexadecimal equivalent.
Parameters:
| Name | Type | Description |
|---|---|---|
decimalNum |
number | The decimal number to convert. |
Returns:
The hexadecimal representation of the decimal number.
- Type
- string
(static) decoct(decimalNum) → {string}
Converts a decimal number to its octal equivalent.
Parameters:
| Name | Type | Description |
|---|---|---|
decimalNum |
number | The decimal number to convert. |
Returns:
The octal representation of the decimal number.
- Type
- string
(static) deg2rad(degrees) → {number}
Converts degrees to radians.
Parameters:
| Name | Type | Description |
|---|---|---|
degrees |
number | The number in degrees to convert to radians. |
Returns:
The equivalent angle in radians.
- Type
- number
(static) exp(num) → {number}
Calculates the value of 'e' raised to the power of a number.
Parameters:
| Name | Type | Description |
|---|---|---|
num |
number | The exponent. |
Returns:
The result of 'e' raised to the power of the exponent.
- Type
- number
(static) expm1(num) → {number}
Calculates exp(num) - 1, computed in a way that is accurate even when num is close to zero.
Parameters:
| Name | Type | Description |
|---|---|---|
num |
number | The number. |
Returns:
The result of exp(num) - 1.
- Type
- number
(static) fdiv(dividend, divisor) → {number}
Divides two numbers according to IEEE 754 rules.
Parameters:
| Name | Type | Description |
|---|---|---|
dividend |
number | The dividend. |
divisor |
number | The divisor. |
Returns:
The result of dividing the dividend by the divisor.
- Type
- number
(static) floor(num) → {number}
Rounds fractions down to the nearest integer.
Parameters:
| Name | Type | Description |
|---|---|---|
num |
number | The number to round down. |
Returns:
The rounded-down integer.
- Type
- number
(static) fmod(dividend, divisor) → {number}
Returns the floating-point remainder (modulo) of dividing two numbers.
Parameters:
| Name | Type | Description |
|---|---|---|
dividend |
number | The dividend. |
divisor |
number | The divisor. |
Returns:
The remainder of dividing the dividend by the divisor.
- Type
- number
(static) hexdec(hexStr) → {number}
Converts a hexadecimal number to its decimal equivalent.
Parameters:
| Name | Type | Description |
|---|---|---|
hexStr |
string | The hexadecimal number as a string. |
Returns:
The decimal equivalent of the hexadecimal number.
- Type
- number
(static) hypot(x, y) → {number}
Calculates the length of the hypotenuse of a right-angle triangle.
Parameters:
| Name | Type | Description |
|---|---|---|
x |
number | The length of one side of the triangle. |
y |
number | The length of the other side of the triangle. |
Returns:
The length of the hypotenuse.
- Type
- number
(static) intdiv(dividend, divisor) → {number}
Performs integer division.
Parameters:
| Name | Type | Description |
|---|---|---|
dividend |
number | The dividend. |
divisor |
number | The divisor. |
Returns:
The result of dividing the dividend by the divisor, rounded towards zero.
- Type
- number
(static) is_finite(num) → {boolean}
Checks if a value is a legal finite number.
Parameters:
| Name | Type | Description |
|---|---|---|
num |
number | The value to check. |
Returns:
True if the value is finite, false otherwise.
- Type
- boolean
(static) is_infinite(num) → {boolean}
Checks if a value is infinite.
Parameters:
| Name | Type | Description |
|---|---|---|
num |
number | The value to check. |
Returns:
True if the value is infinite, false otherwise.
- Type
- boolean
(static) is_nan(num) → {boolean}
Checks if a value is not a number (NaN).
Parameters:
| Name | Type | Description |
|---|---|---|
num |
number | The value to check. |
Returns:
True if the value is NaN, false otherwise.
- Type
- boolean
(static) log(num) → {number}
Returns the natural logarithm (base 'e') of a number.
Parameters:
| Name | Type | Description |
|---|---|---|
num |
number | The number to calculate the natural logarithm for. |
Returns:
The natural logarithm of the number.
- Type
- number
(static) log10(num) → {number}
Returns the base-10 logarithm of a number.
Parameters:
| Name | Type | Description |
|---|---|---|
num |
number | The number to calculate the base-10 logarithm for. |
Returns:
The base-10 logarithm of the number.
- Type
- number
(static) log1p(num) → {number}
Returns log(1 + num), computed in a way that is accurate even when num is close to zero.
Parameters:
| Name | Type | Description |
|---|---|---|
num |
number | The number. |
Returns:
The result of log(1 + num).
- Type
- number
(static) max(…values) → {number}
Finds the highest value in an array or a set of values.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
values |
number |
<repeatable> |
The values to compare. |
Returns:
The highest value.
- Type
- number
(static) min(…values) → {number}
Finds the lowest value in an array or a set of values.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
values |
number |
<repeatable> |
The values to compare. |
Returns:
The lowest value.
- Type
- number
(static) octdec(octalStr) → {number}
Converts an octal number to its decimal equivalent.
Parameters:
| Name | Type | Description |
|---|---|---|
octalStr |
string | The octal number as a string. |
Returns:
The decimal equivalent of the octal number.
- Type
- number
(static) pi() → {number}
Get the value of pi (π).
Returns:
The mathematical constant pi (π).
- Type
- number
(static) pow(base, exponent) → {number}
Returns the result of raising a number to a given power.
Parameters:
| Name | Type | Description |
|---|---|---|
base |
number | The base number. |
exponent |
number | The exponent. |
Returns:
The result of the exponential expression.
- Type
- number
(static) rad2deg(radians) → {number}
Converts radians to degrees.
Parameters:
| Name | Type | Description |
|---|---|---|
radians |
number | The angle in radians to convert to degrees. |
Returns:
The equivalent angle in degrees.
- Type
- number
(static) round(num) → {number}
Rounds a floating-point number to the nearest integer.
Parameters:
| Name | Type | Description |
|---|---|---|
num |
number | The number to round. |
Returns:
The rounded integer.
- Type
- number
(static) sin(num) → {number}
Returns the sine of a number.
Parameters:
| Name | Type | Description |
|---|---|---|
num |
number | The number to calculate the sine for. |
Returns:
The sine of the number.
- Type
- number
(static) sinh(num) → {number}
Returns the hyperbolic sine of a number.
Parameters:
| Name | Type | Description |
|---|---|---|
num |
number | The number to calculate the hyperbolic sine for. |
Returns:
The hyperbolic sine.
- Type
- number
(static) sqrt(num) → {number}
Returns the square root of a number.
Parameters:
| Name | Type | Description |
|---|---|---|
num |
number | The number to calculate the square root for. |
Returns:
The square root of the number.
- Type
- number
(static) tan(num) → {number}
Returns the tangent of a number.
Parameters:
| Name | Type | Description |
|---|---|---|
num |
number | The number to calculate the tangent for. |
Returns:
The tangent of the number.
- Type
- number
(static) tanh(num) → {number}
Returns the hyperbolic tangent of a number.
Parameters:
| Name | Type | Description |
|---|---|---|
num |
number | The number to calculate the hyperbolic tangent for. |
Returns:
The hyperbolic tangent.
- Type
- number