xref: /aosp_15_r20/external/pytorch/c10/util/MathConstants.cpp (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
1 // define constants like M_PI and C keywords for MSVC
2 #ifdef _MSC_VER
3 #ifndef _USE_MATH_DEFINES
4 #define _USE_MATH_DEFINES
5 #endif
6 #endif
7 
8 #include <c10/util/MathConstants.h>
9 
10 // NOLINTNEXTLINE(modernize-deprecated-headers)
11 #include <math.h>
12 
13 static_assert(M_PI == c10::pi<double>, "c10::pi<double> must be equal to M_PI");
14 static_assert(
15     M_SQRT1_2 == c10::frac_sqrt_2<double>,
16     "c10::frac_sqrt_2<double> must be equal to M_SQRT1_2");
17