Embedded Template Library 1.0
Loading...
Searching...
No Matches
math_constants.h
1/******************************************************************************
2The MIT License(MIT)
3
4Embedded Template Library.
5https://github.com/ETLCPP/etl
6https://www.etlcpp.com
7
8Copyright(c) 2018 John Wellbelove
9
10Permission is hereby granted, free of charge, to any person obtaining a copy
11of this software and associated documentation files(the "Software"), to deal
12in the Software without restriction, including without limitation the rights
13to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
14coPIes of the Software, and to permit persons to whom the Software is
15furnished to do so, subject to the following conditions :
16
17The above copyright notice and this permission notice shall be included in all
18coPIes or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
23AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26SOFTWARE.
27******************************************************************************/
28
29#ifndef ETL_MATH_CONSTANTS_INCLUDED
30#define ETL_MATH_CONSTANTS_INCLUDED
31
32#include "platform.h"
33
34namespace etl
35{
36 namespace private_math_constants
37 {
38 template <typename T = void>
40 {
41 static ETL_CONSTANT double pi = 3.14159265358979;
42 static ETL_CONSTANT double pi_reciprocal = 0.31830988618379;
43 static ETL_CONSTANT double pi_squared = 9.86960440108936;
44 static ETL_CONSTANT double e = 2.71828182845905;
45 static ETL_CONSTANT double e_reciprocal = 0.36787944117144;
46 static ETL_CONSTANT double e_squared = 7.38905609893065;
47 static ETL_CONSTANT double root2 = 1.41421356237310;
48 static ETL_CONSTANT double root2_reciprocal = 0.70710678118655;
49 static ETL_CONSTANT double euler = 0.57721566490153;
50 static ETL_CONSTANT double golden_ratio = 1.61803398874989;
51 };
52
53 template <typename T>
54 ETL_CONSTANT double math_helper<T>::pi;
55
56 template <typename T>
57 ETL_CONSTANT double math_helper<T>::pi_reciprocal;
58
59 template <typename T>
60 ETL_CONSTANT double math_helper<T>::pi_squared;
61
62 template <typename T>
63 ETL_CONSTANT double math_helper<T>::e;
64
65 template <typename T>
66 ETL_CONSTANT double math_helper<T>::e_reciprocal;
67
68 template <typename T>
69 ETL_CONSTANT double math_helper<T>::e_squared;
70
71 template <typename T>
72 ETL_CONSTANT double math_helper<T>::root2;
73
74 template <typename T>
75 ETL_CONSTANT double math_helper<T>::root2_reciprocal;
76
77 template <typename T>
78 ETL_CONSTANT double math_helper<T>::euler;
79
80 template <typename T>
81 ETL_CONSTANT double math_helper<T>::golden_ratio;
82 }
83
85 {
86 };
87}
88
89#endif
bitset_ext
Definition absolute.h:38
Definition math_constants.h:85
Definition math_constants.h:40