Created
January 20, 2020 07:11
-
-
Save cache-tlb/e3a6e4ee77c6e4be57a9e21dfe45e5e8 to your computer and use it in GitHub Desktop.
mysterious c code that prints pi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| long a=10000,b,c=2800,d,e,f[2801],g; | |
| void main(){ | |
| 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); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment