@princedev/calculate
Version:
Fast, lightweight, and extinsible mathematical and statistical functions.
24 lines (21 loc) • 433 B
text/typescript
import exactArguments from '../../_utils/exactArguments';
/**
* @name cube
* @summary Returns the cube of a number.
*
* @description Returns the cube of a number.
*
* @example
* // Normal usage
* let result = cube(2);
* // => 8
*
* @param {numberr} a - number to be cubed.
* @returns {number}
*
* @function pure
*/
export default function cube(a: number): number {
exactArguments(1, arguments);
return a ** 3;
}