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