Anonymous user
Averages/Root mean square: Difference between revisions
m
→{{header|Elena}}
(→{{header|RPL}}: HP-48G version) |
imported>Arakov |
||
(4 intermediate revisions by 4 users not shown) | |||
Line 418:
next i
print sqrt(s / n)</syntaxhighlight>
{{out| Output}}<pre>6.20483682</pre>
end</syntaxhighlight>▼
==={{header|IS-BASIC}}===
Line 683 ⟶ 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[]
=={{header|EchoLisp}}==
Line 695 ⟶ 707:
=={{header|Elena}}==
{{trans|C#}}
ELENA
<syntaxhighlight lang="elena">import extensions;
import system'routines;
Line 703 ⟶ 715:
{
get RootMeanSquare()
= (self.selectBy::(x => x * x).summarize(Real.new()) / self.Length).sqrt();
}
Line 1,892 ⟶ 1,904:
=={{header|RPL}}==
≪ LIST→ → n
≪ 0 1 n '''START'''
n / √
≫ ≫ '<span style="color:blue">RMS</span>' STO
Line 1,903 ⟶ 1,914:
</pre>
{{works with|HP|48G}}
≪ DUP ≪ SQ
≫ '<span style="color:blue">RMS</span>' STO
Line 2,312 ⟶ 2,323:
=={{header|Wren}}==
<syntaxhighlight lang="
System.print(rms)</syntaxhighlight>
|