double sumproduct(double* first1, double* last1, double* first2);
Returns the sums of products of the elements in [first, last).
Parameters:
first1 | Beginning iterator for the first container of elements. |
---|---|
last1 | Ending iterator for the first container of elements. |
first2 | Beginning iterator for the second container of elements. |
Returns:
Sum of the products
Usage:
double s[4] = {1.1, 2.2, 3.3, 4.4};
int t[4] = {4, 3, 2, 1};
double sm = sumproduct(s, s + 4, t);
Header:
#include "descript.h"