problem 1 dot product python

Solutions on MaxInterview for problem 1 dot product python by the best coders in the world

showing results for - "problem 1 dot product python"
Benjamin
26 Mar 2018
1(defun dotp (v u)   (if (or (endp v) (endp u))       0       (+ (* (first v) (first u))          (dotp (rest v) (rest u)))))
Andrea
15 Jan 2019
1function dotProduct(v1:Vector.<Number>, v2:Vector.<Number>):Number{	if(v1.length != v2.length) return NaN;	var sum:Number = 0;	for(var i:uint = 0; i < v1.length; i++)		sum += v1[i]*v2[i];	return sum;}trace(dotProduct(Vector.<Number>([1,3,-5]),Vector.<Number>([4,-2,-1])));
similar questions
queries leading to this page
problem 1 dot product python