I’ve also never seen a fellow engineer simplify pi to just 3, although I have seen a rise of memes from people who think they do.
I would slap someone if I saw them try that, it’s unnecessarily sloppy. 3.14 is the default, and trivial to work with if you’re using a calculator (I would also slap someone if I saw them not using a calculator). Unless you just LIKE having all your calculations be off by almost 5%. Then you’ll come back wondering why so many of your parts are out of tolerance.
Mad_Punda@feddit.org 1 day ago
And then you’re using C++ and they scold you for including cmath for just M_PI because it increases compilation times.
Telemachus93@slrpnk.net 1 day ago
We’re talking about engineers here! We’re using MATLAB or Python if we’re programming at all.
abbadon420@lemm.ee 1 day ago
Your not writing regular python code, your writing a special subset of python intended for engineers and scientists called “bad python code”
Saleh@feddit.org 1 day ago
My code is not intended to be run by any idiots but myself! Anyways why can’t i make sense of what i have written just a montha go?
fushuan@lemmy.blahaj.zone 1 day ago
As a comp sci that interacts a lot with engineers, I feel this in my soul.
someguy3@lemmy.world 17 hours ago
Coder confirmed.
Courantdair@jlai.lu 1 day ago
You can’t say that for all engineers. I’m one and the biggest part of my job is programming in C++
Evilschnuff@feddit.org 1 day ago
Just wanted to say something similar. Any low latency high frequency code is written in c++, c or assembler. And that’s engineers work usually.
fushuan@lemmy.blahaj.zone 1 day ago
As they should, if that’s the only thing you are using it for, don’t introduce a whole header file, just put the following in the constants.h or equivalent that the proj for sure has:
#define M_PI 3.14159265358979323846264338327950288