2018-11-25 03:17:00 +01:00
|
|
|
/**
|
|
|
|
|
* @module math
|
|
|
|
|
*/
|
2018-10-29 21:58:21 +01:00
|
|
|
export const floor = Math.floor
|
2018-12-03 17:09:00 +01:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @function
|
|
|
|
|
* @param {number} a
|
|
|
|
|
* @param {number} b
|
|
|
|
|
* @return {number} The sum of a and b
|
|
|
|
|
*/
|
|
|
|
|
export const add = (a, b) => a + b
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @function
|
|
|
|
|
* @param {number} a
|
|
|
|
|
* @param {number} b
|
|
|
|
|
* @return {number} The smaller element of a and b
|
|
|
|
|
*/
|
|
|
|
|
export const min = (a, b) => a < b ? a : b
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @function
|
|
|
|
|
* @param {number} a
|
|
|
|
|
* @param {number} b
|
|
|
|
|
* @return {number} The bigger element of a and b
|
|
|
|
|
*/
|
|
|
|
|
export const max = (a, b) => a > b ? a : b
|