C and C++ standards have never specified any math constants. However, most old versions of C and C++ standard libraries and compilers used to provide many math constants through their
cmath header files. However, in recent years many of these compilers and standard libraries have removed these constants from their header files.
This results in code which uses such constants, say
M_PI in throwing errors like this:
C:\Foobar.cpp(42): error C2065: 'M_PI' : undeclared identifier
I found that GCC still provides these constants, while Visual Studio 2012 provides this only if
_USE_MATH_DEFINES is defined. The latest Visual Studio 2015 has completely removed these constants from their header files.
If you are faced with a situation where these constants are not available, it is easy to redefine them in your own code.
Suggested values of these math constants can be found here. Here is the same obtained from
math.h of Visual Studio 2012: