Given two lists,for example:

z:=[1,2,3,4,5,6]
w:=[1,0,0,1,1,1]

it seems that the sum of the pairwise product is obtained by

reduce(+,[z.i*w.i for i in 1..6])

which is all very well.  But why doesn't

sum(z.i*w.i,i=1..6)

work?  I mean, sum(i^2,i=1..6) is fine.

Thanks,
Alasdair
_______________________________________________
Axiom-developer mailing list
Axiom-developer@nongnu.org
http://lists.nongnu.org/mailman/listinfo/axiom-developer

Reply via email to