Skip to content

Norm

Return Euclidean norm.

Declaration

Source position: math.pp line 861

function Norm(const data: Array of Single) : Float;
function Norm(const data: PSingle; const N: Integer) : Float;
function Norm(const data: Array of Double) : Float;
function Norm(const data: PDouble; const N: Integer) : Float;
function Norm(const data: Array of Extended) : Float;
function Norm(const data: PExtended; const N: Integer) : Float;

Description

Norm calculates the Euclidean norm of the array of data. This equals sqrt(sumofsquares(data)).

The second form accepts a pointer to an array of N values.

Errors

None.

See also

Name Description
sumofsquares Return sum of squares of values.

Example

program Example33;

{ Program to demonstrate the norm function. }

uses math;

var v:array[1..10] of Float;
    I:1..10;

begin
  for I:=low(v) to high(v) do
    v[i]:=random;
  writeln(norm(v));
end.