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



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

randg

Return gaussian distributed random number.

Declaration

Source position: math.pp line 415

function randg(

  mean: float;

  stddev: float

):float;

Description

randg returns a random number which - when produced in large quantities - has a Gaussian distribution with mean mean and standarddeviation stddev.

Errors

None.

See also

mean

  

Return mean value of array

stddev

  

Return standard deviation of data

meanandstddev

  

Return mean and standard deviation of array

Example

Program Example40;

{ Program to demonstrate the randg function. }

Uses Math;

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

begin
  Randomize;
  for I:=low(ExArray) to high(ExArray) do
    ExArray[i]:=Randg(1,0.2);
  MeanAndStdDev(ExArray,Mean,StdDev);
  Writeln('Mean       : ',Mean:8:4);
  Writeln('StdDev     : ',StdDev: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