UNPKG
@sgratzl/science
Version:
latest (2.0.0)
2.0.0
Scientific and statistical computing in JavaScript.
github.com/sgratzl/science.js
sgratzl/science.js
@sgratzl/science
/
src
/
lin
/
dot.js
8 lines
(7 loc)
•
161 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
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; };