29 lines
509 B
JavaScript
29 lines
509 B
JavaScript
/**
|
|
* @module math
|
|
*/
|
|
export const floor = Math.floor
|
|
|
|
/**
|
|
* @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
|