Another update from ingydotnet^djgoku
This commit is contained in:
parent
91df62d461
commit
948b86eafa
7604 changed files with 108452 additions and 22726 deletions
31
Task/Standard-deviation/Pascal/standard-deviation-2.pascal
Normal file
31
Task/Standard-deviation/Pascal/standard-deviation-2.pascal
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
program prj_CalcStdDerv;
|
||||
|
||||
{$APPTYPE CONSOLE}
|
||||
|
||||
uses
|
||||
Math;
|
||||
|
||||
var Series:Array of Extended;
|
||||
UserString:String;
|
||||
|
||||
|
||||
function AppendAndCalc(NewVal:Extended):Extended;
|
||||
|
||||
begin
|
||||
setlength(Series,high(Series)+2);
|
||||
Series[high(Series)] := NewVal;
|
||||
result := PopnStdDev(Series);
|
||||
end;
|
||||
|
||||
const data:array[0..7] of Extended =
|
||||
(2,4,4,4,5,5,7,9);
|
||||
|
||||
var rr: Extended;
|
||||
begin
|
||||
setlength(Series,0);
|
||||
for rr in data do
|
||||
begin
|
||||
writeln(rr,' -> ',AppendAndCalc(rr));
|
||||
end;
|
||||
Readln;
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue