/** * Math utility functions */ /** * Adds two numbers. * * @param augend - The first number in an addition * @param addend - The second number in an addition * @returns Returns the sum * * @example * add(6, 4); * // => 10 */ export declare function add(augend: number, addend: number): number; /** * Computes the ceiling of number. * * @param number - The number to compute the ceiling of * @param precision - The precision to compute the ceiling to * @returns Returns the ceiling * * @example * ceil(4.006); * // => 5 * * ceil(6.004, 2); * // => 6.01 */ export declare function ceil(number: number, precision?: number): number; /** * Divide two numbers. * * @param dividend - The first number in a division * @param divisor - The second number in a division * @returns Returns the quotient * * @example * divide(6, 4); * // => 1.5 */ export declare function divide(dividend: number, divisor: number): number; /** * Computes the floor of number. * * @param number - The number to compute the floor of * @param precision - The precision to compute the floor to * @returns Returns the floor * * @example * floor(4.006); * // => 4 * * floor(0.046, 2); * // => 0.04 */ export declare function floor(number: number, precision?: number): number; /** * Computes the maximum value of array. * * @param array - The array to iterate over * @returns Returns the maximum value * * @example * max([4, 2, 8, 6]); * // => 8 * * max([]); * // => undefined */ export declare function max(array: readonly number[]): number | undefined; /** * 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. * * @param array - The array to iterate over * @param iteratee - The iteratee invoked per element * @returns Returns the maximum value * * @example * const objects = [{ 'n': 1 }, { 'n': 2 }]; * * maxBy(objects, o => o.n); * // => { 'n': 2 } */ export declare function maxBy(array: readonly T[], iteratee: (value: T) => number): T | undefined; /** * Computes the minimum value of array. * * @param array - The array to iterate over * @returns Returns the minimum value * * @example * min([4, 2, 8, 6]); * // => 2 * * min([]); * // => undefined */ export declare function min(array: readonly number[]): number | undefined; /** * This method is like `min` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the criterion by which * the value is ranked. * * @param array - The array to iterate over * @param iteratee - The iteratee invoked per element * @returns Returns the minimum value * * @example * const objects = [{ 'n': 1 }, { 'n': 2 }]; * * minBy(objects, o => o.n); * // => { 'n': 1 } */ export declare function minBy(array: readonly T[], iteratee: (value: T) => number): T | undefined; /** * Multiply two numbers. * * @param multiplier - The first number in a multiplication * @param multiplicand - The second number in a multiplication * @returns Returns the product * * @example * multiply(6, 4); * // => 24 */ export declare function multiply(multiplier: number, multiplicand: number): number; /** * Computes the rounded value of number. * * @param number - The number to round * @param precision - The precision to round to * @returns Returns the rounded number * * @example * round(4.006); * // => 4 * * round(4.006, 2); * // => 4.01 */ export declare function round(number: number, precision?: number): number; /** * Subtract two numbers. * * @param minuend - The first number in a subtraction * @param subtrahend - The second number in a subtraction * @returns Returns the difference * * @example * subtract(6, 4); * // => 2 */ export declare function subtract(minuend: number, subtrahend: number): number; /** * Computes the sum of the values in array. * * @param array - The array to iterate over * @returns Returns the sum * * @example * sum([4, 2, 8, 6]); * // => 20 */ export declare function sum(array: readonly number[]): number; /** * This method is like `sum` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the value to be summed. * * @param array - The array to iterate over * @param iteratee - The iteratee invoked per element * @returns Returns the sum * * @example * const objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; * * sumBy(objects, o => o.n); * // => 20 */ export declare function sumBy(array: readonly T[], iteratee: (value: T) => number): number;