Added experimental makepkg-update-checksums.sh
[mirrors/Programs.git] / c / pic / main.cpp
CommitLineData
8de51304
H
1#include <stdio.h>\r
2#include <math.h>\r
3#include <time.h>\r
4#define PI 3.141592653589793\r
5\r
6int main(void) {\r
7 double currPi=0, i=1;\r
8 clock_t begin, end;\r
9\r
10 begin = clock();\r
11 do {\r
12 currPi+=(4/i - 4/(i+2));\r
13 i+=4;\r
14 } while(fabs(PI-currPi) > 1e-7);\r
15 end = clock();\r
16\r
17 printf("Vypocteno Pi = %lf v case: %f ms.\n", currPi,\r
18 (float)(end-begin)/CLOCKS_PER_SEC * 1000);\r
19 \r
20 //system("PAUSE");\r
21 //return EXIT_SUCCESS;\r
22}\r
This page took 0.143275 seconds and 4 git commands to generate.