MCPcopy Create free account
hub / github.com/asm-js/validator / logSum

Function logSum

test/valid/GeometricMean-umd.js:8–20  ·  view source on GitHub ↗
(start, end)

Source from the content-addressed store, hash-verified

6 var values = new stdlib.Float64Array(buffer);
7
8 function logSum(start, end) {
9 start = start|0;
10 end = end|0;
11
12 var sum = 0.0, p = 0, q = 0;
13
14 // asm.js forces byte addressing of the heap by requiring shifting by 3
15 for (p = start << 3, q = end << 3; (p|0) < (q|0); p = (p + 8)|0) {
16 sum = sum + +log(values[p>>3]);
17 }
18
19 return +sum;
20 }
21
22 function geometricMean(start, end) {
23 start = start|0;

Callers 1

geometricMeanFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected