NORM2 — Euclidean vector norms¶
- NORM2()¶
Calculates the Euclidean vector norm (L_2 norm) of
ARRAYalong dimensionDIM.- Parameters
ARRAY – Shall be an array of type
REALDIM – (Optional) shall be a scalar of type
INTEGERwith a value in the range from 1 to n, where n equals the rank ofARRAY.
- Returns
The result is of the same type as
ARRAY.
Standard:Fortran 2008 and later
Class:Transformational function
Syntax:RESULT = NORM2(ARRAY[, DIM])
Example:PROGRAM test_sum REAL :: x(5) = [ real :: 1, 2, 3, 4, 5 ] print *, NORM2(x) ! = sqrt(55.) ~ 7.416 END PROGRAM