498
Order of magnitude is a hell of a drug
(lemmy.world)
A place for majestic STEMLORD peacocking, as well as memes about the realities of working in a lab.
Rules
This is a science community. We use the Dawkins definition of meme.
as an engineer, a lot of languages (even proprietary ones) have a built-in constant pi variable because it is so ubiquitous - its easier and more readable to use pi than 3........
And then you’re using C++ and they scold you for including cmath for just M_PI because it increases compilation times.
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:
Yes, it's literally what math.h has defined.
If I'm not completely mistaken M_PI is not part of the C standard, so depending on your stdlib or compiler or even compiler flags you will have to define it yourself even in C.