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.

Was it helpful?

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
scroll top