r/ProgrammerHumor • • 18d ago

Meme reversingPiInPython

Post image
14k Upvotes

383 comments sorted by

View all comments

765

u/mmbtc 18d ago

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

304

u/nicki419 18d ago

*clears throat*

e ≈ 3 ≈ π

169

u/AvailableUsername404 18d ago

π2 ≈ g ≈ 10

56

u/DaemonG 18d ago

sqrt(10) ≈ n ≈ 3

36

u/Weird_Photograph_248 18d ago

heh, you wrote squirt

→ More replies (1)

27

u/heaving_in_my_vines 18d ago

≈ tree fiddy

12

u/nicki419 18d ago

That would round up to 4, actually

14

u/Legitimate_Concern_5 18d ago edited 18d ago

Depends on your rounding strategy, sometimes 3 sometime 4. Round half up is the most common but you can round half down, round half towards even (Banker's rounding/Gaussian rounding), round half towards odd, or towards/away from infinity.

→ More replies (2)
→ More replies (1)
→ More replies (1)
→ More replies (2)

203

u/oalfonso 18d ago

Found the mechanical engineer

63

u/lNFORMATlVE 18d ago

The structural engineer: let’s use pi = 10 for safety margin

20

u/ncatter 18d ago

In software we usually just taken out result and mltiply with pi then estimation fits reality.

That number has so many use cases.

35

u/hetfield37 18d ago

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

40

u/EmilMelgaard 18d 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_ 18d ago

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

3.1414...

9

u/himanbam 18d 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 18d ago

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

16

u/hetfield37 18d ago

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

→ More replies (3)

4

u/enti134 18d ago

Ok Bloody Stupid Johnson

4

u/mmbtc 18d ago

Unexpected PTerry reference. I like it.

GNU PTerry

9

u/ul2006kevinb 18d ago

If it's good enough for the Bible it's good enough for me

"And he made a molten sea, ten cubits from the one brim to the other: it was round all about, and his height was five cubits: and a line of thirty cubits did compass it round about."

12

u/BullPropaganda 18d ago

The number of the mathing shall be 3. And 3 shall be the number of the mathing.

→ More replies (4)

11

u/CirnoIzumi 18d ago

mm, but you could round it to 4 for more precision

9

u/Throwaway11958 18d ago

safety margin

→ More replies (4)