add
math
Adds two numbers.
Installation
Import
import { add } from '@tulx/utils';Source Code
Implementation
/**
* Adds two numbers.
*
* @param augend - The first number in an addition.
* @param addend - The second number in an addition.
* @returns Returns the sum.
*
* @example
* ```ts
* add(6, 4); // 10
* ```
*/
export function add(augend: number, addend: number): number {
return augend + addend;
}
Example
import { add } from '@tulx/utils';
add(6, 4); // 10Related Functions
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.
mean
Computes the mean of the values in array.