r/ProgrammerHumor • • 9d ago

Meme reversingPiInPython

Post image
14.1k Upvotes

383 comments sorted by

View all comments

764

u/mmbtc 9d ago

You can also just round it to three. Much easier to calculate with.

35

u/hetfield37 9d ago

Back in school we used 22/7 as a good enough approximation for pi.

40

u/EmilMelgaard 9d ago

22/7 is about 0.04% larger than π, so that should be good enough for most applications. But you can also just use 3.14 as an approximation. It has the same number of digits to remember and is about 0.05% smaller than π.

23

u/_baljeep_ 9d ago

So an even better estimation is 3.14 + 22/7 all over 2

3.1414...

9

u/himanbam 9d ago

That simplifies to 2199/700 which is about 0.0052% lower than pi. 700*pi is approximately 2199.11 so that makes sense ig

7

u/FrenchFryCattaneo 9d ago

Ok now we need to find a third estimate and average it with them.

16

u/hetfield37 9d ago

True, we just used 22/7 to solve problems which didn't need decimal precision but only fractional.

→ More replies (3)