Skip to content

Instantly share code, notes, and snippets.

@classilla
Created November 18, 2018 00:11
Show Gist options
  • Save classilla/e30eb957450ca8a1e034afc42786de14 to your computer and use it in GitHub Desktop.
Save classilla/e30eb957450ca8a1e034afc42786de14 to your computer and use it in GitHub Desktop.
Compute 50 digits of pi using the venerable old dc utility.
[K 1+k 0 1 1lxlx*+v--lx/sxlf 2*sflx .5<=]s=
[K 1+k 0 1 1lxlx*+v--lx/sxlf 2*sflx 0 .5->>]s>
[ltklxlc*ld/Lxs.Las.Lbs.Lcs.Lds.Les.Lfs.Lgs.Lss.Lts. 3Q]s@
[lbls*sblcla*ldlb*+scldla*sdlcld/sglgle=@ lgsela 2+dsas. 1 1=?]s?
[0St0Ss0Sg0Sf0Se0Sd0Sc0Sb0SaSxlx 0=< Kst 1sflx .5<= lx 0 .5->> 0lx-lx*sslfsblfsc 1sd 1se 3dsas. 1 1=? Lxs.Las.Lbs.Lcs.Lds.Les.Lfs.Lgs.Lss.Lts.0 1Q]sQ
50k
4 1lQx*ps.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment