Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Void sekw()
- {
- fprintf(result_file, "Przetwarzanie sekwencyjne;\n");
- clock_t start, stop;
- double x, pi, sum=0.0;
- inti;
- step = 1./(double)num_steps;
- start = clock();
- for (i=0; i<num_steps; i++)
- {
- x = (i + .5)*step;
- sum = sum + 4.0/(1.+ x*x);
- }
- pi = sum*step;
- stop = clock();
- printf(" Wartosc liczby PI wynosi %15.12f\n",pi);
- printf(" Czas przetwarzania wynosi %f sekund\n",((double)(stop - start)/1000.0));
- fprintf(result_file, "Czas przetwarzania wynosi ;%f ;sekund\n",((double)(stop - start)/1000.0));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement