Anonymous user
Averages/Root mean square: Difference between revisions
m
→{{header|Elena}}
Basicgames (talk | contribs) |
imported>Arakov |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 682:
<syntaxhighlight lang="e">? RMS(1..10)
# value: 6.2048368229954285</syntaxhighlight>
=={{header|EasyLang}}==
{{trans|C}}
<syntaxhighlight lang=easylang>
func rms v[] .
for v in v[]
sum += v * v
.
return sqrt (sum / len v[])
.
v[] = [ 1 2 3 4 5 6 7 8 9 10 ]
print rms v[]
</syntaxhighlight>
=={{header|EchoLisp}}==
Line 694 ⟶ 707:
=={{header|Elena}}==
{{trans|C#}}
ELENA
<syntaxhighlight lang="elena">import extensions;
import system'routines;
Line 702 ⟶ 715:
{
get RootMeanSquare()
= (self.selectBy::(x => x * x).summarize(Real.new()) / self.Length).sqrt();
}
Line 1,891 ⟶ 1,904:
=={{header|RPL}}==
≪ LIST→ → n
≪ 0 1 n '''START'''
n / √
≫ ≫ '<span style="color:blue">RMS</span>' STO
Line 1,902 ⟶ 1,914:
</pre>
{{works with|HP|48G}}
≪ DUP ≪ SQ
≫ '<span style="color:blue">RMS</span>' STO
Line 2,311 ⟶ 2,323:
=={{header|Wren}}==
<syntaxhighlight lang="
System.print(rms)</syntaxhighlight>
|