Download Scientific Computing Beyond Matlab

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Transcript
Code Comparison – C
#include <time.h>
#include <stdio.h>
int main()
{
long long unsigned int sum = 0;
long long unsigned int i = 0;
long long unsigned int max = 100000000;
clock_t tic =
for (i = 0; i
sum = sum
}
clock_t toc =
clock();
<= max; i++) {
+ i;
clock();
printf("%15lld, Elapsed: %f seconds\n", sum, (double)(toc - tic) /
CLOCKS_PER_SEC);
return 0;
}
Document related concepts
no text concepts found