计算数字1到10(包括1和10)的均方根 。
均方根也以其首字母RMS(或rms)和二次均值来表示。
RMS计算为数字平方的平均值,平方根:
$$ x _ {\ mathrm {rms}} = \ sqrt {{{x_1} ^ 2 + {x_2} ^ 2 + \ cdots + {x_n} ^ 2} \ over n}。 $$
rms
是一个功能。
testString: 'assert(typeof rms === "function", "rms
is a function.");'
- text: 'rms([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
应等于6.2048368229954285
。'
testString: 'assert.equal(rms(arr1), answer1, "rms([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
should equal 6.2048368229954285
.");'
```