6 lines
143 B
C
6 lines
143 B
C
double mean(const double *x, long n) {
|
|
double total = 0.0;
|
|
for (long i = 0; i < n; i++) total += x[i];
|
|
return total / (double)n;
|
|
}
|