Sign in Join
FPDoc Onlineexperiment

Norm function

In unit Math

Return Euclidean norm.

Declaration

pascal
function Norm(const data: Array of Single): 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

Example: ex33

pascal
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.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.