Averages/Root mean square: Difference between revisions
Content added Content deleted
Alextretyak (talk | contribs) (Added 11l) |
|||
Line 1,780:
=={{header|VBA}}==
Using Excel VBA
<lang vb>Private Function
For i = 1 To UBound(s)
s(i) = s(i) ^ 2
Next i
root_mean_square = Sqr(WorksheetFunction.sum(s) / UBound(s))
End Function
Public Sub pythagorean_means()
Dim s() As Variant
s = [{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}]
Debug.Print root_mean_square(s)
End Sub</lang>
Without using Excel worksheetfunction:
<lang vb>Function rms(iLow As Integer, iHigh As Integer)
Dim i As Integer
If iLow > iHigh Then
Line 1,803 ⟶ 1,815:
6.20483682299543
</pre>
=={{header|Wortel}}==
|