subtract
math
Subtract two numbers.
Installation
Import
import { subtract } from '@tulx/utils';Source Code
Implementation
/**
* Subtract two numbers.
*
* @param minuend - The first number in a subtraction.
* @param subtrahend - The second number in a subtraction.
* @returns Returns the difference.
*
* @example
* ```ts
* subtract(6, 4); // 2
* ```
*/
export function subtract(minuend: number, subtrahend: number): number {
return minuend - subtrahend;
}
Example
import { subtract } from '@tulx/utils';
subtract(6, 4); // 2Related Functions
add
Adds two numbers.
ceil
Computes number rounded up to precision.
divide
Divide two numbers.
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.