Computing PI

Started by
9 comments, last by alvaro 17 years, 10 months ago
Try this!
#include <stdio.h>int a=10000,b,c=35000,d,e,f[35001],g;int main(){  for(;b-c;)f[b++]=a/5;  for(;d=0,g=c*2;c-=14,printf("%.4d",e+d/a),fflush(stdout),e=d%a)    for(b=c;d+=f*a,f=d%--g,d/=g--,--b;d*=b);}

This topic is closed to new replies.

Advertisement