I would assume its not standardized because its not really a major concern. I really do not see any hassle in just writing down a #define or const static, or just making a header with a bunch of math constants you may need. Its not really anything anyone composing the standard has on his mind while trying to improve the language.
Why is there no definition of the constant pi in the C++11 standard? [closed]
-
26-06-2022 - |
Question
I find it quiet annoying that I have to use the macro _USE_MATH_DEFINES
in order to get the value of pi into my program. Or I need to define it myself in one of my own headers. Or I have to use boost and all that.
It just annoys me, that there isn't a standard c++ header defining that constant in a portable way. Is there any particular reason that math constants like pi are not in the c++ standard? Could it be in one of the next versions of the standard?
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow