How do I access math constants (eg. M_PI) in Visual C++ 2008?
-
03-07-2019 - |
Question
I want to use the math constants, such as M_PI and M_E, in Visual C++ 2008. I assumed they were defined in the cmath header.
Solution
They are, but you also need to #define _USE_MATH_DEFINES
before you #include <cmath>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow