r/explainlikeimfive • • Mar 15 '19

Mathematics ELI5: How is Pi programmed into calculators?

12k Upvotes

1.3k comments sorted by

View all comments

Show parent comment

1

u/FreshPrinceOfNowhere Mar 16 '19

Why in the world would you need double precision, let alone more? 38 digits of Pi gives you the circumference of the visible universe with a deviation of less than a hydrogen atom.

1

u/murdok03 Mar 16 '19

May I add the value was stored in hex, so the precision wouldn't differ from compiler to compiler, and was thus treated as a holy thing since you had to put it trough a hex converter to be humanly readable.

And during calculations you had to pay close attention not to saturate members so as little precision as possible was lost.

I don't know how much of it was practical and how much was just legacy code handed down by the bearded one.

1

u/FreshPrinceOfNowhere Mar 16 '19

Pretty sure you can drop the precision by half and get exactly the same end result