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



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

stddev

Return standard deviation of data

Declaration

Source position: line 0

function stddev(

  const data: array of Extended

):float;

function stddev(

  const data: PExtended;

  const N: Integer

):float;

Description

Stddev returns the standard deviation of the values in Data. It returns zero if there is only one value.

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

Errors

None.

See also

mean

  

Return mean value of array

meanandstddev

  

Return mean and standard deviation of array

variance

  

Return variance of values

totalvariance

  

Return total varians of values

Example

Program Example40;

{ Program to demonstrate the stddev function. }

Uses Math;

Var
  I : Integer;
  ExArray : Array[1..10000] of Float;

begin
  Randomize;
  for I:=low(ExArray) to high(ExArray) do
    ExArray[i]:=Randg(1,0.2);
  Writeln('StdDev     : ',StdDev(ExArray):8:4);
  Writeln('StdDev (b) : ',StdDev(@ExArray[0],10000):8:4);
end.

Notes

 No notes exist for this page yet. 





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