summaryrefslogtreecommitdiff
path: root/fpcdocs/mathex/ex40.pp
blob: 6cee9335f41732a57eeec9875fc6c9a34ef1d56e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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.