norm ( k -- x )
Factor handbook » The language » Numbers » Vector operations » Vector arithmetic

Prev:l1-norm ( k -- x )
Next:l-infinity-norm ( k -- x )


Vocabulary
math.vectors

Inputs
ka sequence


Outputs
xa non-negative real number


Generic word contract
Computes the norm (size) of k in 𝑙₂ (L^2) vector space, usually written ∥・∥₂.

Notes
This is generally the "default norm", and when referring to an unqualified norm, so it is an alias for the l2-norm implementation.

Examples
USING: math.vectors math.functions prettyprint ; { 1 2 3 4 } norm 5.4772255 10e-8 ~ .
t


See also
norm-sq, l1-norm, l-infinity-norm, p-norm

Definition