Cube
Gets the cube of a given number.
Syntax
cube(a: number): number
Parameters
a: number
- Given number to be cubed.
Returns
number
- The resulting cube.
Error
Throws an error if the length of arguments is not equal to 1.
Import
import { cube } from '@princedev/calculate';
Examples
Basic usage with a given number.
const result = cube(2);
result
would be 8
const result = cube(-8);
result
would be -512