RosettaCodeData/Task/Cumulative-standard-deviation/Phix/cumulative-standard-deviation-2.phix
2026-04-30 12:34:36 -04:00

6 lines
222 B
Text

with javascript_semantics
constant testset = {2, 4, 4, 4, 5, 5, 7, 9}
for i,t in testset do
sequence test = testset[1..i]
printf(1,"N=%d Item=%d Avg=%5.3f StdDev=%5.3f\n",{i,t,average(test),std_dev(test)})
end for