Skip to content

Instantly share code, notes, and snippets.

@wchristian
Created March 13, 2015 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wchristian/c871df0c607b0b85a98b to your computer and use it in GitHub Desktop.
Save wchristian/c871df0c607b0b85a98b to your computer and use it in GitHub Desktop.
int dot_product( int *a, int *b, size_t n ) {
int sum = 0;
size_t i;
for ( i = 0; i < n; i++ ) {
sum += a[i] * b[i];
}
return sum;
}
@mohawk2
Copy link

mohawk2 commented Mar 22, 2015

There's now an example on this branch of Inline::C - ingydotnet/inline-c-pm#39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment