[58b6d1b] | 1 | // |
---|
[53ba273] | 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. |
---|
[58b6d1b] | 6 | // |
---|
| 7 | // limits.c -- |
---|
| 8 | // |
---|
[53ba273] | 9 | // Author : Peter A. Buhr |
---|
| 10 | // Created On : Wed Apr 6 18:06:52 2016 |
---|
| 11 | // Last Modified By : Peter A. Buhr |
---|
[43f29f6] | 12 | // Last Modified On : Fri Feb 17 12:25:39 2023 |
---|
| 13 | // Update Count : 87 |
---|
[58b6d1b] | 14 | // |
---|
[53ba273] | 15 | |
---|
[2701c91] | 16 | #include <limits.h> |
---|
| 17 | #include <float.h> |
---|
| 18 | #include <math.h> |
---|
| 19 | #include <complex.h> |
---|
[58b6d1b] | 20 | #include "limits.hfa" |
---|
[53ba273] | 21 | |
---|
[0aa4beb] | 22 | #pragma GCC visibility push(default) |
---|
| 23 | |
---|
[53ba273] | 24 | // Integral Constants |
---|
| 25 | |
---|
[6fbe9a5] | 26 | const signed char MIN = SCHAR_MIN; |
---|
| 27 | const unsigned char MIN = 0; |
---|
| 28 | const short int MIN = SHRT_MIN; |
---|
| 29 | const unsigned short int MIN = 0; |
---|
| 30 | const int MIN = INT_MIN; |
---|
| 31 | const unsigned int MIN = 0; |
---|
| 32 | const long int MIN = LONG_MIN; |
---|
| 33 | const unsigned long int MIN = 0; |
---|
| 34 | const long long int MIN = LLONG_MIN; |
---|
| 35 | const unsigned long long int MIN = 0; |
---|
| 36 | |
---|
| 37 | const signed char MAX = SCHAR_MAX; |
---|
| 38 | const unsigned char MAX = UCHAR_MAX; |
---|
| 39 | const short int MAX = SHRT_MAX; |
---|
| 40 | const unsigned short int MAX = USHRT_MAX; |
---|
| 41 | const int MAX = INT_MAX; |
---|
| 42 | const unsigned int MAX = UINT_MAX; |
---|
| 43 | const long int MAX = LONG_MAX; |
---|
| 44 | const unsigned long int MAX = ULONG_MAX; |
---|
| 45 | const long long int MAX = LLONG_MAX; |
---|
| 46 | const unsigned long long int MAX = ULLONG_MAX; |
---|
[53ba273] | 47 | |
---|
| 48 | // Floating-Point Constants |
---|
| 49 | |
---|
[6fbe9a5] | 50 | const float MIN = FLT_MIN; |
---|
| 51 | const double MIN = DBL_MIN; |
---|
| 52 | const long double MIN = LDBL_MIN; |
---|
| 53 | const float _Complex MIN = __FLT_MIN__ + __FLT_MIN__ * I; |
---|
| 54 | const double _Complex MIN = DBL_MIN + DBL_MIN * I; |
---|
| 55 | const long double _Complex MIN = LDBL_MIN + LDBL_MIN * I; |
---|
| 56 | |
---|
| 57 | const float MAX = FLT_MAX; |
---|
| 58 | const double MAX = DBL_MAX; |
---|
| 59 | const long double MAX = LDBL_MAX; |
---|
| 60 | const float _Complex MAX = FLT_MAX + FLT_MAX * I; |
---|
| 61 | const double _Complex MAX = DBL_MAX + DBL_MAX * I; |
---|
| 62 | const long double _Complex MAX = LDBL_MAX + LDBL_MAX * I; |
---|
| 63 | |
---|
| 64 | const float PI = (float)M_PI; // pi |
---|
| 65 | const float PI_2 = (float)M_PI_2; // pi / 2 |
---|
| 66 | const float PI_4 = (float)M_PI_4; // pi / 4 |
---|
| 67 | const float _1_PI = (float)M_1_PI; // 1 / pi |
---|
| 68 | const float _2_PI = (float)M_2_PI; // 2 / pi |
---|
| 69 | const float _2_SQRT_PI = (float)M_2_SQRTPI; // 2 / sqrt(pi) |
---|
| 70 | |
---|
| 71 | const double PI = M_PI; // pi |
---|
| 72 | const double PI_2 = M_PI_2; // pi / 2 |
---|
| 73 | const double PI_4 = M_PI_4; // pi / 4 |
---|
| 74 | const double _1_PI = M_1_PI; // 1 / pi |
---|
| 75 | const double _2_PI = M_2_PI; // 2 / pi |
---|
| 76 | const double _2_SQRT_PI = M_2_SQRTPI; // 2 / sqrt(pi) |
---|
| 77 | |
---|
| 78 | const long double PI = M_PIl; // pi |
---|
| 79 | const long double PI_2 = M_PI_2l; // pi / 2 |
---|
| 80 | const long double PI_4 = M_PI_4l; // pi / 4 |
---|
| 81 | const long double _1_PI = M_1_PIl; // 1 / pi |
---|
| 82 | const long double _2_PI = M_2_PIl; // 2 / pi |
---|
| 83 | const long double _2_SQRT_PI = M_2_SQRTPIl; // 2 / sqrt(pi) |
---|
| 84 | |
---|
| 85 | const float _Complex PI = (float)M_PI + 0.0_iF; // pi |
---|
| 86 | const float _Complex PI_2 = (float)M_PI_2 + 0.0_iF; // pi / 2 |
---|
| 87 | const float _Complex PI_4 = (float)M_PI_4 + 0.0_iF; // pi / 4 |
---|
| 88 | const float _Complex _1_PI = (float)M_1_PI + 0.0_iF; // 1 / pi |
---|
| 89 | const float _Complex _2_PI = (float)M_2_PI + 0.0_iF; // 2 / pi |
---|
| 90 | const float _Complex _2_SQRT_PI = (float)M_2_SQRTPI + 0.0_iF; // 2 / sqrt(pi) |
---|
| 91 | |
---|
| 92 | const double _Complex PI = M_PI + 0.0_iD; // pi |
---|
| 93 | const double _Complex PI_2 = M_PI_2 + 0.0_iD; // pi / 2 |
---|
| 94 | const double _Complex PI_4 = M_PI_4 + 0.0_iD; // pi / 4 |
---|
| 95 | const double _Complex _1_PI = M_1_PI + 0.0_iD; // 1 / pi |
---|
| 96 | const double _Complex _2_PI = M_2_PI + 0.0_iD; // 2 / pi |
---|
| 97 | const double _Complex _2_SQRT_PI = M_2_SQRTPI + 0.0_iD; // 2 / sqrt(pi) |
---|
| 98 | |
---|
| 99 | const long double _Complex PI = M_PIl + 0.0_iL; // pi |
---|
| 100 | const long double _Complex PI_2 = M_PI_2l + 0.0_iL; // pi / 2 |
---|
| 101 | const long double _Complex PI_4 = M_PI_4l + 0.0_iL; // pi / 4 |
---|
| 102 | const long double _Complex _1_PI = M_1_PIl + 0.0_iL; // 1 / pi |
---|
| 103 | const long double _Complex _2_PI = M_2_PIl + 0.0_iL; // 2 / pi |
---|
| 104 | const long double _Complex _2_SQRT_PI = M_2_SQRTPIl + 0.0_iL; // 2 / sqrt(pi) |
---|
| 105 | |
---|
| 106 | const float E = (float)M_E; // e |
---|
| 107 | const float LOG2_E = (float)M_LOG2E; // log_2(e) |
---|
| 108 | const float LOG10_E = (float)M_LOG10E; // log_10(e) |
---|
| 109 | const float LN_2 = (float)M_LN2; // log_e(2) |
---|
| 110 | const float LN_10 = (float)M_LN10; // log_e(10) |
---|
| 111 | const float SQRT_2 = (float)M_SQRT2; // sqrt(2) |
---|
| 112 | const float _1_SQRT_2 = (float)M_SQRT1_2; // 1 / sqrt(2) |
---|
| 113 | |
---|
| 114 | const double E = M_E; // e |
---|
| 115 | const double LOG2_E = M_LOG2E; // log_2(e) |
---|
| 116 | const double LOG10_E = M_LOG10E; // log_10(e) |
---|
| 117 | const double LN_2 = M_LN2; // log_e(2) |
---|
| 118 | const double LN_10 = M_LN10; // log_e(10) |
---|
| 119 | const double SQRT_2 = M_SQRT2; // sqrt(2) |
---|
| 120 | const double _1_SQRT_2 = M_SQRT1_2; // 1 / sqrt(2) |
---|
| 121 | |
---|
| 122 | const long double E = M_El; // e |
---|
| 123 | const long double LOG2_E = M_LOG2El; // log_2(e) |
---|
| 124 | const long double LOG10_E = M_LOG10El; // log_10(e) |
---|
| 125 | const long double LN_2 = M_LN2l; // log_e(2) |
---|
| 126 | const long double LN_10 = M_LN10l; // log_e(10) |
---|
| 127 | const long double SQRT_2 = M_SQRT2l; // sqrt(2) |
---|
| 128 | const long double _1_SQRT_2 = M_SQRT1_2l; // 1 / sqrt(2) |
---|
| 129 | |
---|
| 130 | const float _Complex E = M_E + 0.0_iF; // e |
---|
| 131 | const float _Complex LOG2_E = M_LOG2E + 0.0_iF; // log_2(e) |
---|
| 132 | const float _Complex LOG10_E = M_LOG10E + 0.0_iF; // log_10(e) |
---|
| 133 | const float _Complex LN_2 = M_LN2 + 0.0_iF; // log_e(2) |
---|
| 134 | const float _Complex LN_10 = M_LN10 + 0.0_iF; // log_e(10) |
---|
| 135 | const float _Complex SQRT_2 = M_SQRT2 + 0.0_iF; // sqrt(2) |
---|
| 136 | const float _Complex _1_SQRT_2 = M_SQRT1_2 + 0.0_iF; // 1 / sqrt(2) |
---|
| 137 | |
---|
| 138 | const double _Complex E = M_E + 0.0_iD; // e |
---|
| 139 | const double _Complex LOG2_E = M_LOG2E + 0.0_iD; // log_2(e) |
---|
| 140 | const double _Complex LOG10_E = M_LOG10E + 0.0_iD; // log_10(e) |
---|
| 141 | const double _Complex LN_2 = M_LN2 + 0.0_iD; // log_e(2) |
---|
| 142 | const double _Complex LN_10 = M_LN10 + 0.0_iD; // log_e(10) |
---|
| 143 | const double _Complex SQRT_2 = M_SQRT2 + 0.0_iD; // sqrt(2) |
---|
| 144 | const double _Complex _1_SQRT_2 = M_SQRT1_2 + 0.0_iD; // 1 / sqrt(2) |
---|
| 145 | |
---|
| 146 | const long double _Complex E = M_El + 0.0_iL; // e |
---|
| 147 | const long double _Complex LOG2_E = M_LOG2El + 0.0_iL; // log_2(e) |
---|
| 148 | const long double _Complex LOG10_E = M_LOG10El + 0.0_iL; // log_10(e) |
---|
| 149 | const long double _Complex LN_2 = M_LN2l + 0.0_iL; // log_e(2) |
---|
| 150 | const long double _Complex LN_10 = M_LN10l + 0.0_iL; // log_e(10) |
---|
| 151 | const long double _Complex SQRT_2 = M_SQRT2l + 0.0_iL; // sqrt(2) |
---|
| 152 | const long double _Complex _1_SQRT_2 = M_SQRT1_2l + 0.0_iL; // 1 / sqrt(2) |
---|
[53ba273] | 153 | |
---|
| 154 | // Local Variables: // |
---|
| 155 | // mode: c // |
---|
| 156 | // tab-width: 4 // |
---|
| 157 | // End: // |
---|