|
||||
This mysterious π 3.141592..., which comes in at every door and window, and down every chimney.
Augustus De Morgan (1806-1871) |
||||
The following tiny C code computes digits of π (Boris Gourevitch) main() { int a=10000,b,c=8400,d,e,f[8401],g; for(;b-c;)f[b++]=a/5; for(;d=0,g=c*2;c-=14,printf("%.4d",e+d/a),e=d%a) for(b=c;d+=f[b]*a,f[b]=d%--g,d/=g--,--b;d*=b); } |
||||
1) Wolfram Mathworld |