UNPKG

@sgratzl/science

Version:

Scientific and statistical computing in JavaScript.

8 lines (7 loc) 161 B
export default function dot(a, b) { var s = 0, i = -1, n = Math.min(a.length, b.length); while (++i < n) s += a[i] * b[i]; return s; };