This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Download Microsoft Edge
More info about Internet Explorer and Microsoft Edge
Microsoft provides several predefined preprocessor macros for common math constants.
Syntax
#define _USE_MATH_DEFINES // for C++
#include <cmath>
#define _USE_MATH_DEFINES // for C
#include <math.h>
The following symbols are defined for the values of their indicated expressions:
Symbol
Expression
Value
The math constants aren't defined in Standard C/C++. To use them, you must first define _USE_MATH_DEFINES
, and then include <cmath>
or <math.h>
.
The file <ATLComTime.h>
includes <math.h>
when your project is built in Release mode. If you use one or more of the math constants in a project that also includes <ATLComTime.h>
, you must define _USE_MATH_DEFINES
before you include <ATLComTime.h>
.
See also
Global constants