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);
resultwould be 4
const result = sqaure(-8);
resultwould be 64