Algosim documentation: sqr

sqr

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, sqr is more convenient to write than x ↦ x^2.

Examples

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

See also