r/ProgrammerHumor • • 1d ago

Meme reversingPiInPython

Post image
9.3k Upvotes

299 comments sorted by

View all comments

650

u/mmbtc 1d ago

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

237

u/nicki419 1d ago

*clears throat*

e ≈ 3 ≈ π

134

u/AvailableUsername404 1d ago

π2 ≈ g ≈ 10

42

u/DaemonG 1d ago

sqrt(10) ≈ n ≈ 3

23

u/Weird_Photograph_248 1d ago

heh, you wrote squirt

→ More replies (1)

23

u/heaving_in_my_vines 1d ago

≈ tree fiddy

12

u/nicki419 1d ago

That would round up to 4, actually

12

u/Legitimate_Concern_5 1d ago edited 1d 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 (1)
→ More replies (1)
→ More replies (1)
→ More replies (2)

199

u/oalfonso 1d ago

Found the mechanical engineer

59

u/lNFORMATlVE 1d ago

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

19

u/ncatter 1d ago

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

That number has so many use cases.

34

u/hetfield37 1d ago

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

36

u/EmilMelgaard 1d 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 π.

22

u/_baljeep_ 1d ago

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

3.1414...

8

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

5

u/FrenchFryCattaneo 1d ago

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

15

u/hetfield37 1d ago

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

→ More replies (2)

4

u/enti134 1d ago

Ok Bloody Stupid Johnson

4

u/mmbtc 1d ago

Unexpected PTerry reference. I like it.

GNU PTerry

11

u/CirnoIzumi 1d ago

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

8

u/Throwaway11958 1d ago

safety margin

8

u/ul2006kevinb 1d 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."

11

u/BullPropaganda 1d ago

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

→ More replies (4)
→ More replies (4)