How do I access math constants (eg. M_PI) in Visual C++ 2008?

后端 未结 1 1264
囚心锁ツ
囚心锁ツ 2020-12-16 10:53

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.

相关标签:
1条回答
  • 2020-12-16 11:28

    They are, but you also need to #define _USE_MATH_DEFINES before you #include <cmath>

    0 讨论(0)
提交回复
热议问题