Maximize the dimensions while keeping the same aspect ratio.

Calculate the factorial of an integer greater than or equal to 0.

Determine the result of using AND, OR, or XOR on an array of values.

Simple trigonometric functions with the option to specify the value in degrees or radians: cosine, sine, tangent, cosecant, contangent, and secant.

Determine whether a number is a prime integer or a composite integer or neither.

Written by
Christopher West (cwest).
Last updated
1 year ago.
Includes

`isComposite`

and `isPrime`

.
Finds the remainder after dividing one number by another number while assuring that the remainder always carries the same sign as the divisor.

Determines if a string can be represented as a finite number.

Convert degrees to radians and radians to degrees.

Find the minimum and maximum values.

Use this function to make sure that a given number will always be within a given range.

Written by
Christopher West (cwest).
Last updated
2 years ago.
Includes

`clamp`

.
Tags:
Number

Working with fractions and exponents of two.

Allows for rounding with precision with minimal risk of floating-point rounding issues.

Written by
Christopher West (cwest).
Last updated
2 years ago.
Includes

`ceil`

, `floor`

and `round`

.
Tags:
Number

Just gets the integral part of a number.

Written by
Christopher West (cwest).
Last updated
2 years ago.
Includes

`trunc`

.
Tags:
Number

Gets the fractional part of a number, removing the integral part.

Written by
Christopher West (cwest).
Last updated
2 years ago.
Includes

`frac`

.
Tags:
Number

Determine whether or not a value is a number which is also a float or an integer.

Written by
Christopher West (cwest).
Last updated
2 years ago.
Includes

`isFloat`

and `isInt`

.
Tests a value to see if it is a number that is also finite.

Written by
Christopher West (cwest).
Last updated
2 years ago.
Includes

`isFinite`

.
Determines if what is passed in is literally NaN.

Written by
Christopher West (cwest).
Last updated
2 years ago.
Includes

`isNaN`

.
Determines if the argument that is passed in is an integer in the range of -9007199254740991 and 9007199254740991.

Written by
Christopher West (cwest).
Last updated
2 years ago.
Includes

`isSafeInt`

.
Gets the logarithm of a given number with an optional given base.

Creates an array of numbers within a given range.

Find the greatest common divisor and the least common multiple of two integers quickly and simply.

Get the ordinal for an integer. In other words, you will be able to determine if "st", "nd", "rd" or "th" should be added to the end of a number.