Created
November 30, 2025 05:21
-
-
Save RYSF13/74cb504688faa80b79b5fa7c0663594c to your computer and use it in GitHub Desktop.
Calculate sqrt(2) to 2333 digits(use spigot)
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
| a=1e3,b,c=1413,d,f[1414],n=800,k;main(){for(;b<c; | |
| f[b++]=14);for(;n--;d+=*f*a,printf("%02d",d/a),*f | |
| =d%a)for(d=0,k=c;--k;d/=b,d*=2*k-1)f[k]=(d+=f[k]* | |
| a)%(b=100*k);}/* √2 2333 digits - Robert Ryan */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment