We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bcbab68 commit c8f6098Copy full SHA for c8f6098
src/jswrap_espruino.c
@@ -374,8 +374,13 @@ JsVarFloat jswrap_espruino_sum(JsVar *arr) {
374
"typescript" : "variance(arr: string | number[] | ArrayBuffer, mean: number): number;"
375
}
376
Work out the variance of the contents of the given Array, String or ArrayBuffer
377
-and return the result. This is equivalent to `v=0;for (i in arr)
378
-v+=Math.pow(mean-arr[i],2)`
+and return the result. This is equivalent to:
+
379
+```
380
+v=0;
381
+for (i in arr)
382
+ v+=Math.pow(mean-arr[i],2);
383
+````
384
*/
385
JsVarFloat jswrap_espruino_variance(JsVar *arr, JsVarFloat mean) {
386
if (!(jsvIsIterable(arr))) {
0 commit comments