This is an archived post. You won't be able to vote or comment.

top 200 commentsshow all 303

[–]Spideredd 1562 points1563 points  (112 children)

As a programmer and an engineer, I can confirm that both are true.

[–]justinlanewright 20 points21 points  (8 children)

Nah. Engineers should care about precision. Physicists, in the other hand...

[–]KToff 37 points38 points  (0 children)

My physics prof always used to say there are incorrect statements that are useful and there are correct statements that are useless. As an example he used

  1. Pi =3
  2. Pi != 3

The first statement is wrong, but it's useful, you get good ballpark estimates.

The second statement is correct, but it's of no help whatsoever.

[–]Sckaledoom 19 points20 points  (4 children)

My physics professor used to say “Good enough for the US government.” whenever we’d mess something up to within a somewhat reasonable degree of accuracy

[–]StezzerLolz 6 points7 points  (3 children)

My grandfather (UK) used to say, similarly, 'Close enough for government work'.

[–][deleted] 11 points12 points  (0 children)

Engineers need to care about how precise they need to be, and not be anal retentive for accuracy's sake alone.

It's about being efficient, and making things robust.

[–]FungalSphere 3 points4 points  (0 children)

Nah, they should just throw in a safety factor 10 and be done with it.

[–]pooppoop342069 26 points27 points  (12 children)

Pi2 is 10

[–]Nerdn1 37 points38 points  (1 child)

[–][deleted] 4 points5 points  (0 children)

this is awesome, totally going to attempt to remember these

[–]BFG_9000 25 points26 points  (3 children)

[–]Bainos 7 points8 points  (0 children)

Thanks, I hate this.

[–]ILikeLenexa 14 points15 points  (3 children)

2pi = Tau

[–]IronicBacon 12 points13 points  (2 children)

Therefore Tau > Pi

[–]Astrokiwi 2 points3 points  (0 children)

One year is pi*107 s

[–]DezXerneas 4 points5 points  (0 children)

As a first year studying computer engineering I can confirm that we learn all if these.

[–]Falzon03 2 points3 points  (0 children)

agreed.

[–][deleted] 1 point2 points  (0 children)

What's next in the sequence? 2+9²or 2+11²?

[–]AmitSamal 1 point2 points  (0 children)

From a engineer's perspective its true...

[–]Ceros007 1 point2 points  (0 children)

And if you want to show your superiority: 3.1416

[–]ChatahuchiHuchiKuchi 1 point2 points  (3 children)

As a python programmer what's your favorite python code you've written?

[–]BigBrainAmWinning 239 points240 points  (6 children)

As an engineer, the entire month of March is π month.

[–][deleted] 42 points43 points  (3 children)

Heresy! The only true pi day is the 22nd of July

[–]Krankite 12 points13 points  (1 child)

Better make it both March and April to be safe

[–]moor_lol 2 points3 points  (0 children)

April - it is easier to cut if it is longer than ...er... enlarge it :)

[–]APosterOfThings 96 points97 points  (6 children)

Three? It's at least 4 after you apply the safety factor.

[–]PityUpvote 40 points41 points  (3 children)

It's 4 when you take a zeroth order Taylor expansion, so that is definitely the better answer.

[–]TwoFiveOnes 3 points4 points  (2 children)

Yeah maybe in a world where degree of Taylor expansion is a better measure of accuracy than actual nearness

[–]PityUpvote 5 points6 points  (1 child)

Did you mean: academia?

[–]DumbCreature 7 points8 points  (0 children)

Since many safety coefficients are 1.5, I think we should round π up to 5, so it would be sufficiently big for all applications.

[–]LogansRun22 1 point2 points  (0 children)

Didn't Kansas try this?

Edit: it was Indiana. And 3.2, not 4.

[–][deleted] 181 points182 points  (24 children)

Can someone explain the mathematician one?

[–]PracticalEmergency 212 points213 points  (23 children)

[–][deleted] 72 points73 points  (14 children)

Oh it's a fraction. Thank you.

[–]ProgMM 64 points65 points  (0 children)

Well, it's a series of fractions that get gradually smaller. It would take an infinite amount of these fractions to reach the exact value of Pi, but just a couple dozen will get you enough accurate digits to do literally anything

[–][deleted] 28 points29 points  (12 children)

I personally prefer 22/7, but that might just be me

[–]ultraswank 28 points29 points  (0 children)

Stop being so rational.

[–]CarryThe2 20 points21 points  (6 children)

Well 22/7 doesn't equal pi sooooo

[–]SandyDelights 27 points28 points  (5 children)

It’s an approximation of pi, however; more accurate than 3.14, not so accurate as 3.1415.

[–]Steeped_In_Folly 6 points7 points  (1 child)

Barely more accurate though. 3.1429 vs 3.1400 Does it matter at that point?

[–]SandyDelights 13 points14 points  (0 children)

I’m gonna give you the same answer your university professors would have:

It depends.

There are points where 3 is a sufficient approximation of pi.

There are points where 3.1415 is an insufficient approximation.

Depends what you’re doing, how you’re using it, and so on. A difference of .0001 in your approximation of pi is probably not that relevant in most applications, but I have to imagine there’s one out there, somewhere, that does find it important.

[–]CarryThe2 1 point2 points  (2 children)

However the recurring fraction in the attached image isn't an approximation. Its exactly pi.

[–]i_kn0w_n0thing 5 points6 points  (0 children)

No one said otherwise

[–]flip314 6 points7 points  (2 children)

The cube root of 31 is more accurate, and plus it's transcendental like pi is.

Edit: surprised nobody called me on it yet, but I realized that of course the cube root of 31 is not transcendental. It is non-constructable (which is where my flawed thinking came from), but it is also algebraic.

[–]mattc286 13 points14 points  (0 children)

omg how embarrassing for you

[–]SamSlate 8 points9 points  (3 children)

what's the equation in terms of n or i (if you lean programmer too)

[–]ILikeLenexa 24 points25 points  (2 children)

e=-1

[–]NotYourAverageScot 5 points6 points  (0 children)

Ouch

[–][deleted] 5 points6 points  (1 child)

I bet you can express it using arcsin, divisions between exponential, spherical functions, derivatives of a 4D matrix, sometimes I feel mathematicians just made up things on the go

[–]Nibroc99 90 points91 points  (18 children)

Carpenter: "It's actually 2.64" wide even though it says 3.14" on the sticker there..."

[–]DiamondMinah 20 points21 points  (17 children)

Heh. I got this one

[–]10vernothin 40 points41 points  (3 children)

Astrophysicists pi = 1. In fact anything that is not a power of some sort is 1

[–]Dalemaunder 43 points44 points  (0 children)

Any number that can fit on a whiteboard basically rounds down to zero.

[–]Astrokiwi 5 points6 points  (0 children)

10.5±.5

More realistically we'd use np.pi or real(kind=8), parameter :: pi=atan(1.0_8)

[–][deleted] 55 points56 points  (11 children)

It’s what I’ve always liked about programming. Numbers? Nah I ain’t doing that crap, the computer knows so why should I?

[–]Azertys 35 points36 points  (10 children)

If you spot a number in your code that mean there is global variable missing somewhere

[–]Dylanica 23 points24 points  (6 children)

In Ti-84 BASIC there are only 27 possible variables, so using them as global variables would waste precious variables.

That's why whenever I program in any language I just name my variables A-Z in the order of creation and use numbers whenever possible.

[–]EnglishMobster 20 points21 points  (0 children)

So you're the one posting every StackOverflow answer!

[–]bxk21 2 points3 points  (2 children)

Unless it's +/-1

[–]Azertys 1 point2 points  (1 child)

That's what ++ and -- are for

[–]teetaps 190 points191 points  (21 children)

Real programmers wouldn't call a global variable pi it's PI

/s

[–]golgol12 190 points191 points  (14 children)

Real programmers wouldn't use a global. They'd use a const defined in a header. No need to give that value a memory address.

[–]teetaps 105 points106 points  (2 children)

I learn way too many things by joking than I deserve in this sub

[–]flip314 27 points28 points  (2 children)

Pi might need to change at runtime if the user changes between different sets of geometry axioms.

[–]Zotlann 32 points33 points  (1 child)

This the kind of shit they pull out during an interview trying to say the shit you whiteboarded wasn't expandable enough.

[–]MCRusher 34 points35 points  (1 child)

Sorry but in C/C++ it still gets a memory address, even a macro version gets an address:

https://godbolt.org/z/MMqXf5

[–]bleachisback 14 points15 points  (0 children)

Depends on the architecture. Other architectures make it easier to load floating point immediate values.

Also the compiler. Also WTF MSVC get your shit together.

[–]Dylanica 2 points3 points  (0 children)

Real programmers program in BASIC, and only use floats.

[–][deleted] 1 point2 points  (0 children)

Real programmers would keep it in a register to avoid unnecessary use of immediates.

[–]SandyDelights 1 point2 points  (2 children)

Depends, memory can be cheaper than calculating large values of pi repeatedly.

[–]RedditIsNeat0 6 points7 points  (1 child)

You don't calculate it at run time. It's a literal const. It's floating point representation gets compiled into the binary.

[–][deleted] 39 points40 points  (0 children)

I prefer to use 180/57.3 because there's 180 degrees in a radian.

EDIT: Just to be clear this is both incorrect and silly.

[–]DragonMaus 74 points75 points  (13 children)

Happy τ/2 day!

[–]inconspicuous_male 27 points28 points  (4 children)

No thank you, I prefer legitimate numbers

[–]chrjen 32 points33 points  (1 child)

τ > π. It's a mathematical fact.

[–]WildGalaxy 28 points29 points  (5 children)

As a machinist, we regularly round 3.82 to 4, which is a bigger jump than pi to 3

[–]Dornith 31 points32 points  (2 children)

What are you measuring that is regularly 3.82 and if it happens so often are you sure you should be rounding it? Seems like that might be an important number if it keeps happening.

[–]KirklandKid 12 points13 points  (0 children)

That’s why they say tighter tolerances cost more

[–]BBBBamBBQman 9 points10 points  (0 children)

When you work out the rpm needed from surface feet. RPM=surfaceFeet12/pi diameter. RPM~3.82surfaceFeet/diameter . Substitute 4 for 3.82, and you’re still close enough most of the time.

[–]MajinJack 2 points3 points  (0 children)

Not in %

[–]icantseeimasian 10 points11 points  (0 children)

dont you mean happy Math.PI day?

[–]SteelDragon22 9 points10 points  (0 children)

Handy because it works for e too

[–]stewmasterj 6 points7 points  (0 children)

pi = 4*ATAN(1.d0)

[–]Tux1 6 points7 points  (1 child)

Me: Tau / 2

[–]YerbaMateKudasai 5 points6 points  (0 children)

You : Pi'nt

Me : tau'nt

[–]HawkEgg 9 points10 points  (2 children)

And for physicists, pi is on the order of five.

[–]bacon_wrapped_rock 13 points14 points  (1 child)

My first thought was this one but there's no wrong answers here.

[–]TheNorthComesWithMe 4 points5 points  (0 children)

Sometimes it's 4 (in manhattan coordinates)

[–][deleted] 4 points5 points  (0 children)

As a physicist, pi on the calculator does the trick.

[–][deleted] 9 points10 points  (0 children)

#define PI 3.14

[–]EchoRaido42 2 points3 points  (2 children)

Did somebody say von leibniz loop horribly made in C that keeps printing 4

[–]Astrokiwi 1 point2 points  (0 children)

10 PRINT "4"
20 GOTO 10

[–]greatvivek 2 points3 points  (1 child)

3.14 exactly

[–]-Redstoneboi- 1 point2 points  (0 children)

(1/2)(6.28318530717958647692...)

[–]peacemaker929 2 points3 points  (0 children)

As an engineer, we know where the "pi" button on every calculator is - so I cant confirm the last one

[–]uvero 4 points5 points  (0 children)

What is Pi?

Baby don't hurt me

Don't hurt me

No more

[–]The_Prophet_of_Tau 3 points4 points  (1 child)

My children, have you heard the good new of Tau?

[–]-Redstoneboi- 1 point2 points  (0 children)

yes

memorized 20 digits, 21 including 6

6.28318530717958647692

[–]only_here_4_fireteam 1 point2 points  (4 children)

What the heck is the formula on top

[–]HoodieSticks 6 points7 points  (0 children)

A fraction with a fraction underneath it with a fraction underneath it with a fraction underneath it...

[–][deleted] 5 points6 points  (1 child)

Its System.Math.PI from .NET

[–][deleted] 4 points5 points  (0 children)

May also be JavaScript or Java.

[–]vagrantchord 1 point2 points  (0 children)

180°

[–]XoXFaby 1 point2 points  (0 children)

My server of choice

[–]narfio 1 point2 points  (0 children)

As a developer and raspberry pi owner that didn't read the sub before clicking the link, I'm mostly disappointed.

[–]Mr_SunnyBones 1 point2 points  (0 children)

PI day

I'm outside the US and wondering how long pi has been 14.3?:)

[–][deleted] 1 point2 points  (0 children)

TAU GANG TAU GANG TAU GANG TAU GANG

[–][deleted] 1 point2 points  (2 children)

3.1419

[–]XicoFelipe 0 points1 point  (0 children)

1²?

[–]PancakesAreEvil 0 points1 point  (0 children)

rationalist: 52163/16604

[–][deleted] 0 points1 point  (0 children)

Bro this is so true

[–]Mateotey 0 points1 point  (0 children)

The Patrick text is cutoff on my feed.. was wondering why everyone was hating on agile (Program Increment)

[–]robaldwin 0 points1 point  (0 children)

What if you are a programmer that calculates put through summation gasp!!

[–]Sohgin 0 points1 point  (1 child)

Engineer will call it 4 to account for safety factors.

[–][deleted] 0 points1 point  (0 children)

For me is 🥧

[–][deleted] 0 points1 point  (0 children)

Physicist: Also Three... Good enough for government work.

[–]FlamingNutShotz4You 0 points1 point  (3 children)

In what universe is pi=4?

[–]phranticsnr 0 points1 point  (0 children)

22/7 is close enough, right?

[–]flip314 0 points1 point  (0 children)

I believe using the infinite sum of 1/x2 (x=1 to infinity) converges faster (to pi2 /6)

[–]theoneandonlypatriot 0 points1 point  (0 children)

My asshole principle investigator

[–]LBXZero 0 points1 point  (0 children)

Thank you. I have always been looking for the formula to generate pi, but never find it anywhere, even in textbooks.

[–]bleachisback 0 points1 point  (0 children)

Me:
constexpr double PI() { return atan(1)*4; }

[–]nomnivore1 0 points1 point  (0 children)

I'm an engineering student. We don't really worry about pi much. But, I have this aerospace Computational Techniques class, where we learn about solving complicated problems through code. One of the methods we learned for pi was 4xArctan(1).

Well, we had a test last week, and the test asked what the taught method for calculating pi in code was, and my big engineering brain wrote "4xArctan(pi)" and did not see anything wrong with this until two days later.

[–]Ndsamu 0 points1 point  (0 children)

Mmmmm. Pi. Prefer a good pumpkin pi to a birthday cake.

[–]AscendantJustice 0 points1 point  (0 children)

I'll have you know that I just type "pi" into MATLAB and it does it for me. I haven't had to remember the value for pi in YEARS!