sq()

Calculates the square of a number.

Squaring a number means multiplying the number by itself. For example, sq(3) evaluates 3 × 3 which is 9. sq(-3) evaluates -3 × -3 which is also 9. Multiplying two negative numbers produces a positive number. The value returned by sq() is always positive.

Examples

Syntax

sq(n)

Parameters

n
Number:

number to square.

Returns

Number: squared number.
Notice any errors or typos? Please let us know. Please feel free to edit src/math/calculation.js and open a pull request!

Related References