Jump to content

Averages/Root mean square: Difference between revisions

(→‎{{header|Tcl}}: ++ sather)
Line 220:
 
(1..10).quadratic_mean # => 6.20483682299543</lang>
 
=={{header|Sather}}==
<lang sather>class MAIN is
-- irrms stands for Integer Ranged RMS
irrms(i, f:INT):FLT is
if i > f then
t ::= f;
f := i;
i := t;
end;
sum ::= 0;
loop
sum := sum + i.upto!(f).pow(2);
end;
return (sum.flt / (f-i+1).flt).sqrt;
end;
 
main is
#OUT + irrms(1, 10) + "\n";
end;
end;</lang>
 
 
=={{header|Tcl}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.