Algosim documentation: square

square

A function that squares its argument.

Syntax

Description

Notes

Typically, you write x^2 to square a number or matrix x. However, if you need the squaring operation as a function, square is more convenient to write than x ↦ x^2.

Examples

square(5)
25
square(❨3, 0, −2❩)
13
square(❨❨2, 1❩, ❨i, 3❩❩)
⎛4 + i   5  ⎞
⎝ 5⋅i  9 + i⎠
SequenceVector(20) @ square
(1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256, 289, 324, 361, 400)
SequenceVector(10) @ prime @ square
(4, 9, 25, 49, 121, 169, 289, 361, 529, 841)

See also