1 | // |
---|
2 | // Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo |
---|
3 | // |
---|
4 | // The contents of this file are covered under the licence agreement in the |
---|
5 | // file "LICENCE" distributed with Cforall. |
---|
6 | // |
---|
7 | // limits.c -- |
---|
8 | // |
---|
9 | // Author : Peter A. Buhr |
---|
10 | // Created On : Wed Apr 6 18:06:52 2016 |
---|
11 | // Last Modified By : Peter A. Buhr |
---|
12 | // Last Modified On : Mon Sep 12 10:34:48 2016 |
---|
13 | // Update Count : 17 |
---|
14 | // |
---|
15 | |
---|
16 | #include "limits" |
---|
17 | |
---|
18 | // Integral Constants |
---|
19 | |
---|
20 | const short int MIN = -32768; |
---|
21 | const int MIN = -2147483648; |
---|
22 | #if __WORDSIZE == 64 |
---|
23 | const long int MIN = -9223372036854775807L - 1L; |
---|
24 | #else |
---|
25 | const long int MIN = (int)MIN; |
---|
26 | #endif // M64 |
---|
27 | const long long int MIN = -9223372036854775807LL - 1LL; |
---|
28 | |
---|
29 | const short int MAX = 32767; |
---|
30 | const unsigned short int MAX = 65535; |
---|
31 | const int MAX = 2147483647; |
---|
32 | const unsigned int MAX = 4294967295_U; |
---|
33 | #if __WORDSIZE == 64 |
---|
34 | const long int MAX = 9223372036854775807_L; |
---|
35 | #else |
---|
36 | const long int MAX = (int)MAX; |
---|
37 | #endif // M64 |
---|
38 | const unsigned long int MAX = 4294967295_U; |
---|
39 | const long long int MAX = 9223372036854775807_LL; |
---|
40 | const unsigned long long int MAX = 18446744073709551615_ULL; |
---|
41 | |
---|
42 | // Floating-Point Constants |
---|
43 | |
---|
44 | const float PI = 3.141592_F; // pi |
---|
45 | const float PI_2 = 1.570796_F; // pi / 2 |
---|
46 | const float PI_4 = 0.7853981_F; // pi / 4 |
---|
47 | const float _1_PI = 0.3183098_F; // 1 / pi |
---|
48 | const float _2_PI = 0.6366197_F; // 2 / pi |
---|
49 | const float _2_SQRT_PI = 1.128379_F; // 2 / sqrt(pi) |
---|
50 | |
---|
51 | const double PI = 3.14159265358979323846_D; // pi |
---|
52 | const double PI_2 = 1.57079632679489661923_D; // pi / 2 |
---|
53 | const double PI_4 = 0.78539816339744830962_D; // pi / 4 |
---|
54 | const double _1_PI = 0.31830988618379067154_D; // 1 / pi |
---|
55 | const double _2_PI = 0.63661977236758134308_D; // 2 / pi |
---|
56 | const double _2_SQRT_PI = 1.12837916709551257390_D; // 2 / sqrt(pi) |
---|
57 | |
---|
58 | const long double PI = 3.1415926535897932384626433832795029_DL; // pi |
---|
59 | const long double PI_2 = 1.5707963267948966192313216916397514_DL; // pi / 2 |
---|
60 | const long double PI_4 = 0.7853981633974483096156608458198757_DL; // pi / 4 |
---|
61 | const long double _1_PI = 0.3183098861837906715377675267450287_DL; // 1 / pi |
---|
62 | const long double _2_PI = 0.6366197723675813430755350534900574_DL; // 2 / pi |
---|
63 | const long double _2_SQRT_PI = 1.1283791670955125738961589031215452_DL; // 2 / sqrt(pi) |
---|
64 | |
---|
65 | const double _Complex PI = 3.14159265358979323846_D+0.0_iD; // pi |
---|
66 | const double _Complex PI_2 = 1.57079632679489661923_D+0.0_iD; // pi / 2 |
---|
67 | const double _Complex PI_4 = 0.78539816339744830962_D+0.0_iD; // pi / 4 |
---|
68 | const double _Complex _1_PI = 0.31830988618379067154_D+0.0_iD; // 1 / pi |
---|
69 | const double _Complex _2_PI = 0.63661977236758134308_D+0.0_iD; // 2 / pi |
---|
70 | const double _Complex _2_SQRT_PI = 1.12837916709551257390_D+0.0_iD; // 2 / sqrt(pi) |
---|
71 | |
---|
72 | const long double _Complex PI = 3.1415926535897932384626433832795029_L+0.0iL; // pi |
---|
73 | const long double _Complex PI_2 = 1.5707963267948966192313216916397514_L+0.0iL; // pi / 2 |
---|
74 | const long double _Complex PI_4 = 0.7853981633974483096156608458198757_L+0.0iL; // pi / 4 |
---|
75 | const long double _Complex _1_PI = 0.3183098861837906715377675267450287_L+0.0iL; // 1 / pi |
---|
76 | const long double _Complex _2_PI = 0.6366197723675813430755350534900574_L+0.0iL; // 2 / pi |
---|
77 | const long double _Complex _2_SQRT_PI = 1.1283791670955125738961589031215452_L+0.0iL; // 2 / sqrt(pi) |
---|
78 | |
---|
79 | const float E = 2.718281; // e |
---|
80 | const float LOG2_E = 1.442695; // log_2(e) |
---|
81 | const float LOG10_E = 0.4342944; // log_10(e) |
---|
82 | const float LN_2 = 0.6931471; // log_e(2) |
---|
83 | const float LN_10 = 2.302585; // log_e(10) |
---|
84 | const float SQRT_2 = 1.414213; // sqrt(2) |
---|
85 | const float _1_SQRT_2 = 0.7071067; // 1 / sqrt(2) |
---|
86 | |
---|
87 | const double E = 2.7182818284590452354_D; // e |
---|
88 | const double LOG2_E = 1.4426950408889634074_D; // log_2(e) |
---|
89 | const double LOG10_E = 0.43429448190325182765_D; // log_10(e) |
---|
90 | const double LN_2 = 0.69314718055994530942_D; // log_e(2) |
---|
91 | const double LN_10 = 2.30258509299404568402_D; // log_e(10) |
---|
92 | const double SQRT_2 = 1.41421356237309504880_D; // sqrt(2) |
---|
93 | const double _1_SQRT_2 = 0.70710678118654752440_D; // 1 / sqrt(2) |
---|
94 | |
---|
95 | const long double E = 2.7182818284590452353602874713526625_DL; // e |
---|
96 | const long double LOG2_E = 1.4426950408889634073599246810018921_DL; // log_2(e) |
---|
97 | const long double LOG10_E = 0.4342944819032518276511289189166051_DL; // log_10(e) |
---|
98 | const long double LN_2 = 0.6931471805599453094172321214581766_DL; // log_e(2) |
---|
99 | const long double LN_10 = 2.3025850929940456840179914546843642_DL; // log_e(10) |
---|
100 | const long double SQRT_2 = 1.4142135623730950488016887242096981_DL; // sqrt(2) |
---|
101 | const long double _1_SQRT_2 = 0.7071067811865475244008443621048490_DL; // 1/sqrt(2) |
---|
102 | |
---|
103 | const double _Complex E = 2.7182818284590452354_D+0.0_iD; // e |
---|
104 | const double _Complex LOG2_E = 1.4426950408889634074_D+0.0_iD; // log_2(e) |
---|
105 | const double _Complex LOG10_E = 0.43429448190325182765_D+0.0_iD; // log_10(e) |
---|
106 | const double _Complex LN_2 = 0.69314718055994530942_D+0.0_iD; // log_e(2) |
---|
107 | const double _Complex LN_10 = 2.30258509299404568402_D+0.0_iD; // log_e(10) |
---|
108 | const double _Complex SQRT_2 = 1.41421356237309504880_D+0.0_iD; // sqrt(2) |
---|
109 | const double _Complex _1_SQRT_2 = 0.70710678118654752440_D+0.0_iD; // 1 / sqrt(2) |
---|
110 | |
---|
111 | const long double _Complex E = 2.7182818284590452353602874713526625_L+0.0_iL; // e |
---|
112 | const long double _Complex LOG2_E = 1.4426950408889634073599246810018921_L+0.0_iL; // log_2(e) |
---|
113 | const long double _Complex LOG10_E = 0.4342944819032518276511289189166051_L+0.0_iL; // log_10(e) |
---|
114 | const long double _Complex LN_2 = 0.6931471805599453094172321214581766_L+0.0_iL; // log_e(2) |
---|
115 | const long double _Complex LN_10 = 2.3025850929940456840179914546843642_L+0.0_iL; // log_e(10) |
---|
116 | const long double _Complex SQRT_2 = 1.4142135623730950488016887242096981_L+0.0_iL; // sqrt(2) |
---|
117 | const long double _Complex _1_SQRT_2 = 0.7071067811865475244008443621048490_L+0.0_iL; // 1 / sqrt(2) |
---|
118 | |
---|
119 | // Local Variables: // |
---|
120 | // mode: c // |
---|
121 | // tab-width: 4 // |
---|
122 | // End: // |
---|