Skip to content

Instantly share code, notes, and snippets.

@ramntry
Created July 18, 2018 05:39
Embed
What would you like to do?
double foo(double *a, int n) {
double x = 0.0;
double y = 0.0;
for (int i = 0; i < n; i += 2) {
x += a[i];
y += a[i + 1];
}
return x * y;
}
double bar(double *a, unsigned n) {
double x = 0.0;
double y = 0.0;
for (unsigned i = 0; i < n; i += 2) {
x += a[i];
y += a[i + 1];
}
return x * y;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment