VCCC  2024.05
VisualCamp Common C++ library
constants.hpp
Go to the documentation of this file.
1 # /*
2 # * Created by YongGyu Lee on 2020/12/08.
3 # */
4 #
5 #ifndef VCCC_MATH_CONSTANTS_HPP
6 #define VCCC_MATH_CONSTANTS_HPP
7 
8 namespace vccc {
9 namespace math {
10 
17 //#define M_E 2.71828182845904523536028747135266250 /* e */
18 //#define M_LOG2E 1.44269504088896340735992468100189214 /* log2(e) */
19 //#define M_LOG10E 0.434294481903251827651128918916605082 /* log10(e) */
20 //#define M_LN2 0.693147180559945309417232121458176568 /* loge(2) */
21 //#define M_LN10 2.30258509299404568401799145468436421 /* loge(10) */
22 //#define M_PI 3.14159265358979323846264338327950288 /* pi */
23 //#define M_PI_2 1.57079632679489661923132169163975144 /* pi/2 */
24 //#define M_PI_4 0.785398163397448309615660845819875721 /* pi/4 */
25 //#define M_1_PI 0.318309886183790671537767526745028724 /* 1/pi */
26 //#define M_2_PI 0.636619772367581343075535053490057448 /* 2/pi */
27 //#define M_2_SQRTPI 1.12837916709551257389615890312154517 /* 2/sqrt(pi) */
28 //#define M_SQRT2 1.41421356237309504880168872420969808 /* sqrt(2) */
29 //#define M_SQRT1_2 0.707106781186547524400844362104849039 /* 1/sqrt(2) */
30 //
31 //#define MAXFLOAT 0x1.fffffep+127f
32 
36 template<typename T>
37 constexpr T e = static_cast<T>(2.71828182845904523536028747135266250);
38 
39 //template<typename T>
40 //constexpr auto log2e = 1.44269504088896340735992468100189214;
41 //
42 //template<typename T>
43 //constexpr auto log10e =
44 
45 
49 template<typename T>
50 constexpr T pi = static_cast<T>(3.14159265358979323846264338327950288);
51 
52 
55 
56 } // namespace math
57 } // namespace vccc
58 
59 #endif // VCCC_MATH_CONSTANTS_HPP
constexpr T e
the mathematical constant
Definition: constants.hpp:37
constexpr T pi
the mathematical constant
Definition: constants.hpp:50
Definition: directory.h:12