help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



[Overview][Constants][Types][Classes][Procedures and functions] Reference for unit 'math' (#rtl)

norm

Return Euclidian norm

Declaration

Source position: line 0

function norm(

  const data: array of Extended

):float;

function norm(

  const data: PExtended;

  const N: Integer

):float;

Description

Norm calculates the Euclidian 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

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.

Notes

 No notes exist for this page yet. 





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505