RosettaCodeData/Task/Dot-product/PascalABC.NET/dot-product.pas
2024-10-16 18:07:41 -07:00

4 lines
128 B
ObjectPascal

##
function DotProduct(a, b: array of real) := a.Zip(b, (x, y) -> x * y).Sum;
DotProduct(|1.0, 3, -5|, |4.0, -2, -1|).println;