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