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

后端 未结 1 1265
囚心锁ツ
囚心锁ツ 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

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