30 seconds of code
Click on a snippet card to view the snippet.
Checks if two numbers are approximately equal to each other.
Returns the average of two or more numbers.
Returns the average of an array, after mapping each element to a value using the provided function.
Evaluates the binomial coefficient of two integers
num within the inclusive range specified by the boundary values
Converts an angle from degrees to radians.
Converts a number to an array of digits.
Returns the distance between two points.
Computes the new ratings between two or more opponents using the Elo rating system. It takes an array of pre-ratings and returns an array containing post-ratings. The array should be ordered from best performer to worst performer (winner -> loser).
Calculates the factorial of a number.
Generates an array, containing the Fibonacci sequence, up until the nth term.
Calculates the greatest common divisor between two or more numbers/arrays.
Initializes an array containing the numbers in the specified range where
end are inclusive and the ratio between two terms is
Returns an error if
Calculates the Hamming distance between two values.
Checks if the given number falls within the given range.
Checks if the first numeric argument is divisible by the second one.
true if the given number is even,
Checks if the given value is equal to negative zero (
Checks if the provided integer is a prime number.
Returns the least common multiple of two or more numbers.
Implementation of the Luhn Algorithm used to validate a variety of identification numbers, such as credit card numbers, IMEI numbers, National Provider Identifier numbers etc.
Maps a number from one range to another range.
Returns the maximum value of an array, after mapping each element to a value using the provided function.
Returns the median of an array of numbers.
Calculates the midpoint between two pairs of (x,y) points.
Returns the minimum value of an array, after mapping each element to a value using the provided function.
Uses the percentile formula to calculate how many numbers in the given array are less or equal to the given value.
Returns the powerset of a given array of numbers.
Generates primes up to a given number, using the Sieve of Eratosthenes.
Converts an angle from radians to degrees.
Returns an array of n random integers in the specified range.
Returns a random integer in the specified range.
Returns a random number in the specified range.
Rounds a number to a specified amount of digits.
Hashes the input string into a whole number.
Returns the standard deviation of an array of numbers.
Returns the sum of two or more numbers/arrays.
Returns the sum of an array, after mapping each element to a value using the provided function.
Returns the sum of the powers of all the numbers from
end (both inclusive).
Converts a value to a safe integer.
Returns the distance between two vectors.