mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 20:49:27 +02:00
24 lines
405 B
ObjectPascal
24 lines
405 B
ObjectPascal
Program Example50;
|
|
|
|
{ Program to demonstrate the Variance function. }
|
|
|
|
Uses math;
|
|
|
|
Type
|
|
TExArray = Array[1..100] of Float;
|
|
|
|
Var
|
|
I : Integer;
|
|
ExArray : TExArray;
|
|
V : float;
|
|
|
|
begin
|
|
Randomize;
|
|
for I:=1 to 100 do
|
|
ExArray[i]:=(Random-Random)*100;
|
|
V:=Variance(ExArray);
|
|
Writeln('Variance : ',V:8:4);
|
|
V:=Variance(@ExArray[1],100);
|
|
Writeln('Variance (b) : ',V:8:4);
|
|
end.
|