divide
math
Divide two numbers.
Installation
Import
import { divide } from '@tulx/utils';Source Code
Implementation
/**
* Divide two numbers.
*
* @param dividend - The first number in a division.
* @param divisor - The second number in a division.
* @returns Returns the quotient.
*
* @example
* ```ts
* divide(6, 4); // 1.5
* ```
*/
export function divide(dividend: number, divisor: number): number {
return dividend / divisor;
}
Example
import { divide } from '@tulx/utils';
divide(6, 4); // 1.5Related Functions
add
Adds two numbers.
ceil
Computes number rounded up to precision.
floor
Computes number rounded down to precision.
max
Computes the maximum value of array.
maxBy
This method is like max except that it accepts iteratee which is invoked for each element in array to generate the criterion by which the value is ranked.
mean
Computes the mean of the values in array.