Skip to content

Instantly share code, notes, and snippets.

@cache-tlb
Created January 20, 2020 07:11
Show Gist options
  • Select an option

  • Save cache-tlb/e3a6e4ee77c6e4be57a9e21dfe45e5e8 to your computer and use it in GitHub Desktop.

Select an option

Save cache-tlb/e3a6e4ee77c6e4be57a9e21dfe45e5e8 to your computer and use it in GitHub Desktop.
mysterious c code that prints pi
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