STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
corecrt_math_defines.h
Go to the documentation of this file.
1 //
2 // corecrt_math_defines.h
3 //
4 // Copyright (c) Microsoft Corporation. All rights reserved.
5 //
6 // Definitions of useful mathematical constants
7 //
8 #pragma once
9 
10 #ifndef _MATH_DEFINES_DEFINED
11  #define _MATH_DEFINES_DEFINED
12  // Definitions of useful mathematical constants
13  //
14  // Define _USE_MATH_DEFINES before including <math.h> to expose these macro
15  // definitions for common math constants. These are placed under an #ifdef
16  // since these commonly-defined names are not part of the C or C++ standards
17  #define M_E 2.71828182845904523536 // e
18  #define M_LOG2E 1.44269504088896340736 // log2(e)
19  #define M_LOG10E 0.434294481903251827651 // log10(e)
20  #define M_LN2 0.693147180559945309417 // ln(2)
21  #define M_LN10 2.30258509299404568402 // ln(10)
22  #define M_PI 3.14159265358979323846 // pi
23  #define M_PI_2 1.57079632679489661923 // pi/2
24  #define M_PI_4 0.785398163397448309616 // pi/4
25  #define M_1_PI 0.318309886183790671538 // 1/pi
26  #define M_2_PI 0.636619772367581343076 // 2/pi
27  #define M_2_SQRTPI 1.12837916709551257390 // 2/sqrt(pi)
28  #define M_SQRT2 1.41421356237309504880 // sqrt(2)
29  #define M_SQRT1_2 0.707106781186547524401 // 1/sqrt(2)
30 #endif