|
11 | 11 |
|
12 | 12 | // Constants |
13 | 13 | // Epsilon's, to use as difference limit when comparing float's. |
14 | | -const float EPS_S = 0.0000001f; |
15 | | -const float EPS = 0.0000100f; |
16 | | -const float EPS_L = 0.0010000f; |
| 14 | +constexpr float EPS_S = 0.0000001f; |
| 15 | +constexpr float EPS = 0.0000100f; |
| 16 | +constexpr float EPS_L = 0.0010000f; |
17 | 17 |
|
18 | 18 | #ifdef M_SQRT1_2 |
19 | 19 | #undef M_SQRT1_2 |
20 | 20 | #endif |
21 | 21 | // XXX: The following section contains constants with a _tad_ many decimals to fit in a float. :-) |
22 | 22 | // They used to be macro's, so they could be used as double too. |
23 | | -const float M_SQRT1_2 = 0.7071067811865475244008443621048f;//490; |
| 23 | +constexpr float M_SQRT1_2 = 0.7071067811865475244008443621048f;//490; |
24 | 24 |
|
25 | | -const float M_PI = 3.1415926535897932384626433832795f; |
26 | | -const float PI = 3.1415926535897932384626433832795f; |
27 | | -const float PI_MUL_2 = 6.2831853071795864769252867665590f; |
28 | | -const float PI_MUL_3 = 9.4247779607693797153879301498385f; |
29 | | -const float PI_MUL_4 = 12.566370614359172953850573533118f; |
30 | | -const float PI_MUL_6 = 18.849555921538759430775860299677f; |
31 | | -const float PI_MUL_8 = 25.132741228718345907701147066236f; |
32 | | -const float PI_DIV_2 = 1.5707963267948966192313216916398f; |
33 | | -const float PI_DIV_3 = 1.0471975511965977461542144610932f; |
34 | | -const float PI_DIV_4 = 0.7853981633974483096156608458199f; |
35 | | -const float PI_DIV_6 = 0.5235987755982988730771072305466f; |
36 | | -const float PI_DIV_8 = 0.3926990816987241548078304229099f; |
| 25 | +constexpr float M_PI = 3.1415926535897932384626433832795f; |
| 26 | +constexpr float PI = 3.1415926535897932384626433832795f; |
| 27 | +constexpr float PI_MUL_2 = 6.2831853071795864769252867665590f; |
| 28 | +constexpr float PI_MUL_3 = 9.4247779607693797153879301498385f; |
| 29 | +constexpr float PI_MUL_4 = 12.566370614359172953850573533118f; |
| 30 | +constexpr float PI_MUL_6 = 18.849555921538759430775860299677f; |
| 31 | +constexpr float PI_MUL_8 = 25.132741228718345907701147066236f; |
| 32 | +constexpr float PI_DIV_2 = 1.5707963267948966192313216916398f; |
| 33 | +constexpr float PI_DIV_3 = 1.0471975511965977461542144610932f; |
| 34 | +constexpr float PI_DIV_4 = 0.7853981633974483096156608458199f; |
| 35 | +constexpr float PI_DIV_6 = 0.5235987755982988730771072305466f; |
| 36 | +constexpr float PI_DIV_8 = 0.3926990816987241548078304229099f; |
0 commit comments