Skip to content

Commit

Permalink
Added "mean" function, resolves smuos#2.
Browse files Browse the repository at this point in the history
  • Loading branch information
zoeada committed Oct 2, 2014
1 parent d5ab228 commit c28ea17
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mm.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ int numcmp (const void *a, const void *b) {
return 0;
}

// Function to calculate the mean of a vector
int mean (int *v, int length) {
int i;
int sum = 0;
for(i = 0; i < length; i++) {
sum = sum + v[i];
}
}

int main(int argc, char *argv[]) {

int i, length, *pt;
Expand Down

0 comments on commit c28ea17

Please sign in to comment.