September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
|
|
@ -1,8 +1,8 @@
|
|||
import math
|
||||
from math import sqrt, sum
|
||||
from sequtils import mapIt
|
||||
|
||||
proc qmean(num): float =
|
||||
for n in num:
|
||||
result += n*n
|
||||
proc qmean(num: seq[float]): float =
|
||||
result = num.mapIt(it * it).sum
|
||||
result = sqrt(result / float(num.len))
|
||||
|
||||
echo qmean([1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0])
|
||||
echo qmean(@[1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue