Created
July 18, 2018 05:39
-
-
Save ramntry/61be4548d43bdaaf99f3a5a8d951528b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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