/src/llvm-project-16.0.6.build/include/c++/v1/limits
Line | Count | Source (jump to first uncovered line) |
1 | | // -*- C++ -*- |
2 | | //===----------------------------------------------------------------------===// |
3 | | // |
4 | | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
5 | | // See https://llvm.org/LICENSE.txt for license information. |
6 | | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
7 | | // |
8 | | //===----------------------------------------------------------------------===// |
9 | | |
10 | | #ifndef _LIBCPP_LIMITS |
11 | | #define _LIBCPP_LIMITS |
12 | | |
13 | | /* |
14 | | limits synopsis |
15 | | |
16 | | namespace std |
17 | | { |
18 | | |
19 | | template<class T> |
20 | | class numeric_limits |
21 | | { |
22 | | public: |
23 | | static constexpr bool is_specialized = false; |
24 | | static constexpr T min() noexcept; |
25 | | static constexpr T max() noexcept; |
26 | | static constexpr T lowest() noexcept; |
27 | | |
28 | | static constexpr int digits = 0; |
29 | | static constexpr int digits10 = 0; |
30 | | static constexpr int max_digits10 = 0; |
31 | | static constexpr bool is_signed = false; |
32 | | static constexpr bool is_integer = false; |
33 | | static constexpr bool is_exact = false; |
34 | | static constexpr int radix = 0; |
35 | | static constexpr T epsilon() noexcept; |
36 | | static constexpr T round_error() noexcept; |
37 | | |
38 | | static constexpr int min_exponent = 0; |
39 | | static constexpr int min_exponent10 = 0; |
40 | | static constexpr int max_exponent = 0; |
41 | | static constexpr int max_exponent10 = 0; |
42 | | |
43 | | static constexpr bool has_infinity = false; |
44 | | static constexpr bool has_quiet_NaN = false; |
45 | | static constexpr bool has_signaling_NaN = false; |
46 | | static constexpr float_denorm_style has_denorm = denorm_absent; |
47 | | static constexpr bool has_denorm_loss = false; |
48 | | static constexpr T infinity() noexcept; |
49 | | static constexpr T quiet_NaN() noexcept; |
50 | | static constexpr T signaling_NaN() noexcept; |
51 | | static constexpr T denorm_min() noexcept; |
52 | | |
53 | | static constexpr bool is_iec559 = false; |
54 | | static constexpr bool is_bounded = false; |
55 | | static constexpr bool is_modulo = false; |
56 | | |
57 | | static constexpr bool traps = false; |
58 | | static constexpr bool tinyness_before = false; |
59 | | static constexpr float_round_style round_style = round_toward_zero; |
60 | | }; |
61 | | |
62 | | enum float_round_style |
63 | | { |
64 | | round_indeterminate = -1, |
65 | | round_toward_zero = 0, |
66 | | round_to_nearest = 1, |
67 | | round_toward_infinity = 2, |
68 | | round_toward_neg_infinity = 3 |
69 | | }; |
70 | | |
71 | | enum float_denorm_style |
72 | | { |
73 | | denorm_indeterminate = -1, |
74 | | denorm_absent = 0, |
75 | | denorm_present = 1 |
76 | | }; |
77 | | |
78 | | template<> class numeric_limits<cv bool>; |
79 | | |
80 | | template<> class numeric_limits<cv char>; |
81 | | template<> class numeric_limits<cv signed char>; |
82 | | template<> class numeric_limits<cv unsigned char>; |
83 | | template<> class numeric_limits<cv wchar_t>; |
84 | | template<> class numeric_limits<cv char8_t>; // C++20 |
85 | | template<> class numeric_limits<cv char16_t>; |
86 | | template<> class numeric_limits<cv char32_t>; |
87 | | |
88 | | template<> class numeric_limits<cv short>; |
89 | | template<> class numeric_limits<cv int>; |
90 | | template<> class numeric_limits<cv long>; |
91 | | template<> class numeric_limits<cv long long>; |
92 | | template<> class numeric_limits<cv unsigned short>; |
93 | | template<> class numeric_limits<cv unsigned int>; |
94 | | template<> class numeric_limits<cv unsigned long>; |
95 | | template<> class numeric_limits<cv unsigned long long>; |
96 | | |
97 | | template<> class numeric_limits<cv float>; |
98 | | template<> class numeric_limits<cv double>; |
99 | | template<> class numeric_limits<cv long double>; |
100 | | |
101 | | } // std |
102 | | |
103 | | */ |
104 | | |
105 | | #include <__assert> // all public C++ headers provide the assertion handler |
106 | | #include <__config> |
107 | | #include <__type_traits/is_arithmetic.h> |
108 | | #include <__type_traits/is_signed.h> |
109 | | #include <__type_traits/remove_cv.h> |
110 | | |
111 | | #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) |
112 | | # pragma GCC system_header |
113 | | #endif |
114 | | |
115 | | _LIBCPP_PUSH_MACROS |
116 | | #include <__undef_macros> |
117 | | #include <version> |
118 | | |
119 | | |
120 | | _LIBCPP_BEGIN_NAMESPACE_STD |
121 | | |
122 | | enum float_round_style |
123 | | { |
124 | | round_indeterminate = -1, |
125 | | round_toward_zero = 0, |
126 | | round_to_nearest = 1, |
127 | | round_toward_infinity = 2, |
128 | | round_toward_neg_infinity = 3 |
129 | | }; |
130 | | |
131 | | enum float_denorm_style |
132 | | { |
133 | | denorm_indeterminate = -1, |
134 | | denorm_absent = 0, |
135 | | denorm_present = 1 |
136 | | }; |
137 | | |
138 | | template <class _Tp, bool = is_arithmetic<_Tp>::value> |
139 | | class __libcpp_numeric_limits |
140 | | { |
141 | | protected: |
142 | | typedef _Tp type; |
143 | | |
144 | | static _LIBCPP_CONSTEXPR const bool is_specialized = false; |
145 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return type();} |
146 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return type();} |
147 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return type();} |
148 | | |
149 | | static _LIBCPP_CONSTEXPR const int digits = 0; |
150 | | static _LIBCPP_CONSTEXPR const int digits10 = 0; |
151 | | static _LIBCPP_CONSTEXPR const int max_digits10 = 0; |
152 | | static _LIBCPP_CONSTEXPR const bool is_signed = false; |
153 | | static _LIBCPP_CONSTEXPR const bool is_integer = false; |
154 | | static _LIBCPP_CONSTEXPR const bool is_exact = false; |
155 | | static _LIBCPP_CONSTEXPR const int radix = 0; |
156 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return type();} |
157 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return type();} |
158 | | |
159 | | static _LIBCPP_CONSTEXPR const int min_exponent = 0; |
160 | | static _LIBCPP_CONSTEXPR const int min_exponent10 = 0; |
161 | | static _LIBCPP_CONSTEXPR const int max_exponent = 0; |
162 | | static _LIBCPP_CONSTEXPR const int max_exponent10 = 0; |
163 | | |
164 | | static _LIBCPP_CONSTEXPR const bool has_infinity = false; |
165 | | static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = false; |
166 | | static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = false; |
167 | | static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = denorm_absent; |
168 | | static _LIBCPP_CONSTEXPR const bool has_denorm_loss = false; |
169 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return type();} |
170 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return type();} |
171 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return type();} |
172 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return type();} |
173 | | |
174 | | static _LIBCPP_CONSTEXPR const bool is_iec559 = false; |
175 | | static _LIBCPP_CONSTEXPR const bool is_bounded = false; |
176 | | static _LIBCPP_CONSTEXPR const bool is_modulo = false; |
177 | | |
178 | | static _LIBCPP_CONSTEXPR const bool traps = false; |
179 | | static _LIBCPP_CONSTEXPR const bool tinyness_before = false; |
180 | | static _LIBCPP_CONSTEXPR const float_round_style round_style = round_toward_zero; |
181 | | }; |
182 | | |
183 | | template <class _Tp, int __digits, bool _IsSigned> |
184 | | struct __libcpp_compute_min |
185 | | { |
186 | | static _LIBCPP_CONSTEXPR const _Tp value = _Tp(_Tp(1) << __digits); |
187 | | }; |
188 | | |
189 | | template <class _Tp, int __digits> |
190 | | struct __libcpp_compute_min<_Tp, __digits, false> |
191 | | { |
192 | | static _LIBCPP_CONSTEXPR const _Tp value = _Tp(0); |
193 | | }; |
194 | | |
195 | | template <class _Tp> |
196 | | class __libcpp_numeric_limits<_Tp, true> |
197 | | { |
198 | | protected: |
199 | | typedef _Tp type; |
200 | | |
201 | | static _LIBCPP_CONSTEXPR const bool is_specialized = true; |
202 | | |
203 | | static _LIBCPP_CONSTEXPR const bool is_signed = type(-1) < type(0); |
204 | | static _LIBCPP_CONSTEXPR const int digits = static_cast<int>(sizeof(type) * __CHAR_BIT__ - is_signed); |
205 | | static _LIBCPP_CONSTEXPR const int digits10 = digits * 3 / 10; |
206 | | static _LIBCPP_CONSTEXPR const int max_digits10 = 0; |
207 | | static _LIBCPP_CONSTEXPR const type __min = __libcpp_compute_min<type, digits, is_signed>::value; |
208 | | static _LIBCPP_CONSTEXPR const type __max = is_signed ? type(type(~0) ^ __min) : type(~0); |
209 | 56.4k | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __min;} std::__1::__libcpp_numeric_limits<int, true>::min[abi:v160006]() Line | Count | Source | 209 | 2.09k | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __min;} |
Unexecuted instantiation: std::__1::__libcpp_numeric_limits<long, true>::min[abi:v160006]() Unexecuted instantiation: std::__1::__libcpp_numeric_limits<long long, true>::min[abi:v160006]() std::__1::__libcpp_numeric_limits<short, true>::min[abi:v160006]() Line | Count | Source | 209 | 54.3k | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __min;} |
Unexecuted instantiation: std::__1::__libcpp_numeric_limits<__int128, true>::min[abi:v160006]() |
210 | 91.7M | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __max;} Unexecuted instantiation: std::__1::__libcpp_numeric_limits<unsigned char, true>::max[abi:v160006]() std::__1::__libcpp_numeric_limits<unsigned long, true>::max[abi:v160006]() Line | Count | Source | 210 | 13.3M | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __max;} |
Unexecuted instantiation: std::__1::__libcpp_numeric_limits<long long, true>::max[abi:v160006]() std::__1::__libcpp_numeric_limits<int, true>::max[abi:v160006]() Line | Count | Source | 210 | 35.2k | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __max;} |
std::__1::__libcpp_numeric_limits<unsigned short, true>::max[abi:v160006]() Line | Count | Source | 210 | 40.1M | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __max;} |
std::__1::__libcpp_numeric_limits<long, true>::max[abi:v160006]() Line | Count | Source | 210 | 3.48M | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __max;} |
std::__1::__libcpp_numeric_limits<short, true>::max[abi:v160006]() Line | Count | Source | 210 | 54.3k | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __max;} |
std::__1::__libcpp_numeric_limits<unsigned int, true>::max[abi:v160006]() Line | Count | Source | 210 | 34.6M | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __max;} |
Unexecuted instantiation: std::__1::__libcpp_numeric_limits<char, true>::max[abi:v160006]() Unexecuted instantiation: std::__1::__libcpp_numeric_limits<unsigned long long, true>::max[abi:v160006]() Unexecuted instantiation: std::__1::__libcpp_numeric_limits<wchar_t, true>::max[abi:v160006]() |
211 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return min();} Unexecuted instantiation: std::__1::__libcpp_numeric_limits<long long, true>::lowest[abi:v160006]() Unexecuted instantiation: std::__1::__libcpp_numeric_limits<__int128, true>::lowest[abi:v160006]() |
212 | | |
213 | | static _LIBCPP_CONSTEXPR const bool is_integer = true; |
214 | | static _LIBCPP_CONSTEXPR const bool is_exact = true; |
215 | | static _LIBCPP_CONSTEXPR const int radix = 2; |
216 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return type(0);} |
217 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return type(0);} |
218 | | |
219 | | static _LIBCPP_CONSTEXPR const int min_exponent = 0; |
220 | | static _LIBCPP_CONSTEXPR const int min_exponent10 = 0; |
221 | | static _LIBCPP_CONSTEXPR const int max_exponent = 0; |
222 | | static _LIBCPP_CONSTEXPR const int max_exponent10 = 0; |
223 | | |
224 | | static _LIBCPP_CONSTEXPR const bool has_infinity = false; |
225 | | static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = false; |
226 | | static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = false; |
227 | | static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = denorm_absent; |
228 | | static _LIBCPP_CONSTEXPR const bool has_denorm_loss = false; |
229 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return type(0);} |
230 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return type(0);} |
231 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return type(0);} |
232 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return type(0);} |
233 | | |
234 | | static _LIBCPP_CONSTEXPR const bool is_iec559 = false; |
235 | | static _LIBCPP_CONSTEXPR const bool is_bounded = true; |
236 | | static _LIBCPP_CONSTEXPR const bool is_modulo = !_VSTD::is_signed<_Tp>::value; |
237 | | |
238 | | #if defined(__i386__) || defined(__x86_64__) || defined(__pnacl__) || \ |
239 | | defined(__wasm__) |
240 | | static _LIBCPP_CONSTEXPR const bool traps = true; |
241 | | #else |
242 | | static _LIBCPP_CONSTEXPR const bool traps = false; |
243 | | #endif |
244 | | static _LIBCPP_CONSTEXPR const bool tinyness_before = false; |
245 | | static _LIBCPP_CONSTEXPR const float_round_style round_style = round_toward_zero; |
246 | | }; |
247 | | |
248 | | template <> |
249 | | class __libcpp_numeric_limits<bool, true> |
250 | | { |
251 | | protected: |
252 | | typedef bool type; |
253 | | |
254 | | static _LIBCPP_CONSTEXPR const bool is_specialized = true; |
255 | | |
256 | | static _LIBCPP_CONSTEXPR const bool is_signed = false; |
257 | | static _LIBCPP_CONSTEXPR const int digits = 1; |
258 | | static _LIBCPP_CONSTEXPR const int digits10 = 0; |
259 | | static _LIBCPP_CONSTEXPR const int max_digits10 = 0; |
260 | | static _LIBCPP_CONSTEXPR const type __min = false; |
261 | | static _LIBCPP_CONSTEXPR const type __max = true; |
262 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __min;} |
263 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __max;} |
264 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return min();} |
265 | | |
266 | | static _LIBCPP_CONSTEXPR const bool is_integer = true; |
267 | | static _LIBCPP_CONSTEXPR const bool is_exact = true; |
268 | | static _LIBCPP_CONSTEXPR const int radix = 2; |
269 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return type(0);} |
270 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return type(0);} |
271 | | |
272 | | static _LIBCPP_CONSTEXPR const int min_exponent = 0; |
273 | | static _LIBCPP_CONSTEXPR const int min_exponent10 = 0; |
274 | | static _LIBCPP_CONSTEXPR const int max_exponent = 0; |
275 | | static _LIBCPP_CONSTEXPR const int max_exponent10 = 0; |
276 | | |
277 | | static _LIBCPP_CONSTEXPR const bool has_infinity = false; |
278 | | static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = false; |
279 | | static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = false; |
280 | | static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = denorm_absent; |
281 | | static _LIBCPP_CONSTEXPR const bool has_denorm_loss = false; |
282 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return type(0);} |
283 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return type(0);} |
284 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return type(0);} |
285 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return type(0);} |
286 | | |
287 | | static _LIBCPP_CONSTEXPR const bool is_iec559 = false; |
288 | | static _LIBCPP_CONSTEXPR const bool is_bounded = true; |
289 | | static _LIBCPP_CONSTEXPR const bool is_modulo = false; |
290 | | |
291 | | static _LIBCPP_CONSTEXPR const bool traps = false; |
292 | | static _LIBCPP_CONSTEXPR const bool tinyness_before = false; |
293 | | static _LIBCPP_CONSTEXPR const float_round_style round_style = round_toward_zero; |
294 | | }; |
295 | | |
296 | | template <> |
297 | | class __libcpp_numeric_limits<float, true> |
298 | | { |
299 | | protected: |
300 | | typedef float type; |
301 | | |
302 | | static _LIBCPP_CONSTEXPR const bool is_specialized = true; |
303 | | |
304 | | static _LIBCPP_CONSTEXPR const bool is_signed = true; |
305 | | static _LIBCPP_CONSTEXPR const int digits = __FLT_MANT_DIG__; |
306 | | static _LIBCPP_CONSTEXPR const int digits10 = __FLT_DIG__; |
307 | | static _LIBCPP_CONSTEXPR const int max_digits10 = 2+(digits * 30103l)/100000l; |
308 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __FLT_MIN__;} |
309 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __FLT_MAX__;} |
310 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return -max();} |
311 | | |
312 | | static _LIBCPP_CONSTEXPR const bool is_integer = false; |
313 | | static _LIBCPP_CONSTEXPR const bool is_exact = false; |
314 | | static _LIBCPP_CONSTEXPR const int radix = __FLT_RADIX__; |
315 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return __FLT_EPSILON__;} |
316 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return 0.5F;} |
317 | | |
318 | | static _LIBCPP_CONSTEXPR const int min_exponent = __FLT_MIN_EXP__; |
319 | | static _LIBCPP_CONSTEXPR const int min_exponent10 = __FLT_MIN_10_EXP__; |
320 | | static _LIBCPP_CONSTEXPR const int max_exponent = __FLT_MAX_EXP__; |
321 | | static _LIBCPP_CONSTEXPR const int max_exponent10 = __FLT_MAX_10_EXP__; |
322 | | |
323 | | static _LIBCPP_CONSTEXPR const bool has_infinity = true; |
324 | | static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = true; |
325 | | static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = true; |
326 | | static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = denorm_present; |
327 | | static _LIBCPP_CONSTEXPR const bool has_denorm_loss = false; |
328 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return __builtin_huge_valf();} |
329 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __builtin_nanf("");} |
330 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansf("");} |
331 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __FLT_DENORM_MIN__;} |
332 | | |
333 | | static _LIBCPP_CONSTEXPR const bool is_iec559 = true; |
334 | | static _LIBCPP_CONSTEXPR const bool is_bounded = true; |
335 | | static _LIBCPP_CONSTEXPR const bool is_modulo = false; |
336 | | |
337 | | static _LIBCPP_CONSTEXPR const bool traps = false; |
338 | | #if (defined(__arm__) || defined(__aarch64__)) |
339 | | static _LIBCPP_CONSTEXPR const bool tinyness_before = true; |
340 | | #else |
341 | | static _LIBCPP_CONSTEXPR const bool tinyness_before = false; |
342 | | #endif |
343 | | static _LIBCPP_CONSTEXPR const float_round_style round_style = round_to_nearest; |
344 | | }; |
345 | | |
346 | | template <> |
347 | | class __libcpp_numeric_limits<double, true> |
348 | | { |
349 | | protected: |
350 | | typedef double type; |
351 | | |
352 | | static _LIBCPP_CONSTEXPR const bool is_specialized = true; |
353 | | |
354 | | static _LIBCPP_CONSTEXPR const bool is_signed = true; |
355 | | static _LIBCPP_CONSTEXPR const int digits = __DBL_MANT_DIG__; |
356 | | static _LIBCPP_CONSTEXPR const int digits10 = __DBL_DIG__; |
357 | | static _LIBCPP_CONSTEXPR const int max_digits10 = 2+(digits * 30103l)/100000l; |
358 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __DBL_MIN__;} |
359 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __DBL_MAX__;} |
360 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return -max();} |
361 | | |
362 | | static _LIBCPP_CONSTEXPR const bool is_integer = false; |
363 | | static _LIBCPP_CONSTEXPR const bool is_exact = false; |
364 | | static _LIBCPP_CONSTEXPR const int radix = __FLT_RADIX__; |
365 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return __DBL_EPSILON__;} |
366 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return 0.5;} |
367 | | |
368 | | static _LIBCPP_CONSTEXPR const int min_exponent = __DBL_MIN_EXP__; |
369 | | static _LIBCPP_CONSTEXPR const int min_exponent10 = __DBL_MIN_10_EXP__; |
370 | | static _LIBCPP_CONSTEXPR const int max_exponent = __DBL_MAX_EXP__; |
371 | | static _LIBCPP_CONSTEXPR const int max_exponent10 = __DBL_MAX_10_EXP__; |
372 | | |
373 | | static _LIBCPP_CONSTEXPR const bool has_infinity = true; |
374 | | static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = true; |
375 | | static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = true; |
376 | | static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = denorm_present; |
377 | | static _LIBCPP_CONSTEXPR const bool has_denorm_loss = false; |
378 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return __builtin_huge_val();} |
379 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __builtin_nan("");} |
380 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nans("");} |
381 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __DBL_DENORM_MIN__;} |
382 | | |
383 | | static _LIBCPP_CONSTEXPR const bool is_iec559 = true; |
384 | | static _LIBCPP_CONSTEXPR const bool is_bounded = true; |
385 | | static _LIBCPP_CONSTEXPR const bool is_modulo = false; |
386 | | |
387 | | static _LIBCPP_CONSTEXPR const bool traps = false; |
388 | | #if (defined(__arm__) || defined(__aarch64__)) |
389 | | static _LIBCPP_CONSTEXPR const bool tinyness_before = true; |
390 | | #else |
391 | | static _LIBCPP_CONSTEXPR const bool tinyness_before = false; |
392 | | #endif |
393 | | static _LIBCPP_CONSTEXPR const float_round_style round_style = round_to_nearest; |
394 | | }; |
395 | | |
396 | | template <> |
397 | | class __libcpp_numeric_limits<long double, true> |
398 | | { |
399 | | protected: |
400 | | typedef long double type; |
401 | | |
402 | | static _LIBCPP_CONSTEXPR const bool is_specialized = true; |
403 | | |
404 | | static _LIBCPP_CONSTEXPR const bool is_signed = true; |
405 | | static _LIBCPP_CONSTEXPR const int digits = __LDBL_MANT_DIG__; |
406 | | static _LIBCPP_CONSTEXPR const int digits10 = __LDBL_DIG__; |
407 | | static _LIBCPP_CONSTEXPR const int max_digits10 = 2+(digits * 30103l)/100000l; |
408 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __LDBL_MIN__;} |
409 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __LDBL_MAX__;} |
410 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return -max();} |
411 | | |
412 | | static _LIBCPP_CONSTEXPR const bool is_integer = false; |
413 | | static _LIBCPP_CONSTEXPR const bool is_exact = false; |
414 | | static _LIBCPP_CONSTEXPR const int radix = __FLT_RADIX__; |
415 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return __LDBL_EPSILON__;} |
416 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return 0.5L;} |
417 | | |
418 | | static _LIBCPP_CONSTEXPR const int min_exponent = __LDBL_MIN_EXP__; |
419 | | static _LIBCPP_CONSTEXPR const int min_exponent10 = __LDBL_MIN_10_EXP__; |
420 | | static _LIBCPP_CONSTEXPR const int max_exponent = __LDBL_MAX_EXP__; |
421 | | static _LIBCPP_CONSTEXPR const int max_exponent10 = __LDBL_MAX_10_EXP__; |
422 | | |
423 | | static _LIBCPP_CONSTEXPR const bool has_infinity = true; |
424 | | static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = true; |
425 | | static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = true; |
426 | | static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = denorm_present; |
427 | | static _LIBCPP_CONSTEXPR const bool has_denorm_loss = false; |
428 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return __builtin_huge_vall();} |
429 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __builtin_nanl("");} |
430 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");} |
431 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;} |
432 | | |
433 | | #if defined(__powerpc__) && defined(__LONG_DOUBLE_IBM128__) |
434 | | static _LIBCPP_CONSTEXPR const bool is_iec559 = false; |
435 | | #else |
436 | | static _LIBCPP_CONSTEXPR const bool is_iec559 = true; |
437 | | #endif |
438 | | static _LIBCPP_CONSTEXPR const bool is_bounded = true; |
439 | | static _LIBCPP_CONSTEXPR const bool is_modulo = false; |
440 | | |
441 | | static _LIBCPP_CONSTEXPR const bool traps = false; |
442 | | #if (defined(__arm__) || defined(__aarch64__)) |
443 | | static _LIBCPP_CONSTEXPR const bool tinyness_before = true; |
444 | | #else |
445 | | static _LIBCPP_CONSTEXPR const bool tinyness_before = false; |
446 | | #endif |
447 | | static _LIBCPP_CONSTEXPR const float_round_style round_style = round_to_nearest; |
448 | | }; |
449 | | |
450 | | template <class _Tp> |
451 | | class _LIBCPP_TEMPLATE_VIS numeric_limits |
452 | | : private __libcpp_numeric_limits<__remove_cv_t<_Tp> > |
453 | | { |
454 | | typedef __libcpp_numeric_limits<__remove_cv_t<_Tp> > __base; |
455 | | typedef typename __base::type type; |
456 | | public: |
457 | | static _LIBCPP_CONSTEXPR const bool is_specialized = __base::is_specialized; |
458 | 56.4k | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __base::min();} std::__1::numeric_limits<int>::min[abi:v160006]() Line | Count | Source | 458 | 2.09k | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __base::min();} |
Unexecuted instantiation: std::__1::numeric_limits<long>::min[abi:v160006]() Unexecuted instantiation: std::__1::numeric_limits<long long>::min[abi:v160006]() std::__1::numeric_limits<short>::min[abi:v160006]() Line | Count | Source | 458 | 54.3k | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __base::min();} |
|
459 | 91.7M | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __base::max();} Unexecuted instantiation: std::__1::numeric_limits<unsigned char>::max[abi:v160006]() std::__1::numeric_limits<unsigned long>::max[abi:v160006]() Line | Count | Source | 459 | 13.3M | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __base::max();} |
Unexecuted instantiation: std::__1::numeric_limits<long long>::max[abi:v160006]() std::__1::numeric_limits<int>::max[abi:v160006]() Line | Count | Source | 459 | 35.2k | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __base::max();} |
std::__1::numeric_limits<unsigned short>::max[abi:v160006]() Line | Count | Source | 459 | 40.1M | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __base::max();} |
std::__1::numeric_limits<long>::max[abi:v160006]() Line | Count | Source | 459 | 3.48M | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __base::max();} |
std::__1::numeric_limits<short>::max[abi:v160006]() Line | Count | Source | 459 | 54.3k | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __base::max();} |
std::__1::numeric_limits<unsigned int>::max[abi:v160006]() Line | Count | Source | 459 | 34.6M | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __base::max();} |
Unexecuted instantiation: std::__1::numeric_limits<char>::max[abi:v160006]() Unexecuted instantiation: std::__1::numeric_limits<unsigned long long>::max[abi:v160006]() Unexecuted instantiation: std::__1::numeric_limits<wchar_t>::max[abi:v160006]() |
460 | 0 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return __base::lowest();} Unexecuted instantiation: std::__1::numeric_limits<long long>::lowest[abi:v160006]() Unexecuted instantiation: std::__1::numeric_limits<__int128>::lowest[abi:v160006]() |
461 | | |
462 | | static _LIBCPP_CONSTEXPR const int digits = __base::digits; |
463 | | static _LIBCPP_CONSTEXPR const int digits10 = __base::digits10; |
464 | | static _LIBCPP_CONSTEXPR const int max_digits10 = __base::max_digits10; |
465 | | static _LIBCPP_CONSTEXPR const bool is_signed = __base::is_signed; |
466 | | static _LIBCPP_CONSTEXPR const bool is_integer = __base::is_integer; |
467 | | static _LIBCPP_CONSTEXPR const bool is_exact = __base::is_exact; |
468 | | static _LIBCPP_CONSTEXPR const int radix = __base::radix; |
469 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return __base::epsilon();} |
470 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return __base::round_error();} |
471 | | |
472 | | static _LIBCPP_CONSTEXPR const int min_exponent = __base::min_exponent; |
473 | | static _LIBCPP_CONSTEXPR const int min_exponent10 = __base::min_exponent10; |
474 | | static _LIBCPP_CONSTEXPR const int max_exponent = __base::max_exponent; |
475 | | static _LIBCPP_CONSTEXPR const int max_exponent10 = __base::max_exponent10; |
476 | | |
477 | | static _LIBCPP_CONSTEXPR const bool has_infinity = __base::has_infinity; |
478 | | static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = __base::has_quiet_NaN; |
479 | | static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = __base::has_signaling_NaN; |
480 | | static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = __base::has_denorm; |
481 | | static _LIBCPP_CONSTEXPR const bool has_denorm_loss = __base::has_denorm_loss; |
482 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return __base::infinity();} |
483 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();} |
484 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();} |
485 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __base::denorm_min();} |
486 | | |
487 | | static _LIBCPP_CONSTEXPR const bool is_iec559 = __base::is_iec559; |
488 | | static _LIBCPP_CONSTEXPR const bool is_bounded = __base::is_bounded; |
489 | | static _LIBCPP_CONSTEXPR const bool is_modulo = __base::is_modulo; |
490 | | |
491 | | static _LIBCPP_CONSTEXPR const bool traps = __base::traps; |
492 | | static _LIBCPP_CONSTEXPR const bool tinyness_before = __base::tinyness_before; |
493 | | static _LIBCPP_CONSTEXPR const float_round_style round_style = __base::round_style; |
494 | | }; |
495 | | |
496 | | template <class _Tp> |
497 | | _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_specialized; |
498 | | template <class _Tp> |
499 | | _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::digits; |
500 | | template <class _Tp> |
501 | | _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::digits10; |
502 | | template <class _Tp> |
503 | | _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::max_digits10; |
504 | | template <class _Tp> |
505 | | _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_signed; |
506 | | template <class _Tp> |
507 | | _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_integer; |
508 | | template <class _Tp> |
509 | | _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_exact; |
510 | | template <class _Tp> |
511 | | _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::radix; |
512 | | template <class _Tp> |
513 | | _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::min_exponent; |
514 | | template <class _Tp> |
515 | | _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::min_exponent10; |
516 | | template <class _Tp> |
517 | | _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::max_exponent; |
518 | | template <class _Tp> |
519 | | _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::max_exponent10; |
520 | | template <class _Tp> |
521 | | _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::has_infinity; |
522 | | template <class _Tp> |
523 | | _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::has_quiet_NaN; |
524 | | template <class _Tp> |
525 | | _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::has_signaling_NaN; |
526 | | template <class _Tp> |
527 | | _LIBCPP_CONSTEXPR const float_denorm_style numeric_limits<_Tp>::has_denorm; |
528 | | template <class _Tp> |
529 | | _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::has_denorm_loss; |
530 | | template <class _Tp> |
531 | | _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_iec559; |
532 | | template <class _Tp> |
533 | | _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_bounded; |
534 | | template <class _Tp> |
535 | | _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_modulo; |
536 | | template <class _Tp> |
537 | | _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::traps; |
538 | | template <class _Tp> |
539 | | _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::tinyness_before; |
540 | | template <class _Tp> |
541 | | _LIBCPP_CONSTEXPR const float_round_style numeric_limits<_Tp>::round_style; |
542 | | |
543 | | template <class _Tp> |
544 | | class _LIBCPP_TEMPLATE_VIS numeric_limits<const _Tp> |
545 | | : private numeric_limits<_Tp> |
546 | | { |
547 | | typedef numeric_limits<_Tp> __base; |
548 | | typedef _Tp type; |
549 | | public: |
550 | | static _LIBCPP_CONSTEXPR const bool is_specialized = __base::is_specialized; |
551 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __base::min();} |
552 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __base::max();} |
553 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return __base::lowest();} |
554 | | |
555 | | static _LIBCPP_CONSTEXPR const int digits = __base::digits; |
556 | | static _LIBCPP_CONSTEXPR const int digits10 = __base::digits10; |
557 | | static _LIBCPP_CONSTEXPR const int max_digits10 = __base::max_digits10; |
558 | | static _LIBCPP_CONSTEXPR const bool is_signed = __base::is_signed; |
559 | | static _LIBCPP_CONSTEXPR const bool is_integer = __base::is_integer; |
560 | | static _LIBCPP_CONSTEXPR const bool is_exact = __base::is_exact; |
561 | | static _LIBCPP_CONSTEXPR const int radix = __base::radix; |
562 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return __base::epsilon();} |
563 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return __base::round_error();} |
564 | | |
565 | | static _LIBCPP_CONSTEXPR const int min_exponent = __base::min_exponent; |
566 | | static _LIBCPP_CONSTEXPR const int min_exponent10 = __base::min_exponent10; |
567 | | static _LIBCPP_CONSTEXPR const int max_exponent = __base::max_exponent; |
568 | | static _LIBCPP_CONSTEXPR const int max_exponent10 = __base::max_exponent10; |
569 | | |
570 | | static _LIBCPP_CONSTEXPR const bool has_infinity = __base::has_infinity; |
571 | | static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = __base::has_quiet_NaN; |
572 | | static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = __base::has_signaling_NaN; |
573 | | static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = __base::has_denorm; |
574 | | static _LIBCPP_CONSTEXPR const bool has_denorm_loss = __base::has_denorm_loss; |
575 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return __base::infinity();} |
576 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();} |
577 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();} |
578 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __base::denorm_min();} |
579 | | |
580 | | static _LIBCPP_CONSTEXPR const bool is_iec559 = __base::is_iec559; |
581 | | static _LIBCPP_CONSTEXPR const bool is_bounded = __base::is_bounded; |
582 | | static _LIBCPP_CONSTEXPR const bool is_modulo = __base::is_modulo; |
583 | | |
584 | | static _LIBCPP_CONSTEXPR const bool traps = __base::traps; |
585 | | static _LIBCPP_CONSTEXPR const bool tinyness_before = __base::tinyness_before; |
586 | | static _LIBCPP_CONSTEXPR const float_round_style round_style = __base::round_style; |
587 | | }; |
588 | | |
589 | | template <class _Tp> |
590 | | _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::is_specialized; |
591 | | template <class _Tp> |
592 | | _LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::digits; |
593 | | template <class _Tp> |
594 | | _LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::digits10; |
595 | | template <class _Tp> |
596 | | _LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::max_digits10; |
597 | | template <class _Tp> |
598 | | _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::is_signed; |
599 | | template <class _Tp> |
600 | | _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::is_integer; |
601 | | template <class _Tp> |
602 | | _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::is_exact; |
603 | | template <class _Tp> |
604 | | _LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::radix; |
605 | | template <class _Tp> |
606 | | _LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::min_exponent; |
607 | | template <class _Tp> |
608 | | _LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::min_exponent10; |
609 | | template <class _Tp> |
610 | | _LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::max_exponent; |
611 | | template <class _Tp> |
612 | | _LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::max_exponent10; |
613 | | template <class _Tp> |
614 | | _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::has_infinity; |
615 | | template <class _Tp> |
616 | | _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::has_quiet_NaN; |
617 | | template <class _Tp> |
618 | | _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::has_signaling_NaN; |
619 | | template <class _Tp> |
620 | | _LIBCPP_CONSTEXPR const float_denorm_style numeric_limits<const _Tp>::has_denorm; |
621 | | template <class _Tp> |
622 | | _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::has_denorm_loss; |
623 | | template <class _Tp> |
624 | | _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::is_iec559; |
625 | | template <class _Tp> |
626 | | _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::is_bounded; |
627 | | template <class _Tp> |
628 | | _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::is_modulo; |
629 | | template <class _Tp> |
630 | | _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::traps; |
631 | | template <class _Tp> |
632 | | _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::tinyness_before; |
633 | | template <class _Tp> |
634 | | _LIBCPP_CONSTEXPR const float_round_style numeric_limits<const _Tp>::round_style; |
635 | | |
636 | | template <class _Tp> |
637 | | class _LIBCPP_TEMPLATE_VIS numeric_limits<volatile _Tp> |
638 | | : private numeric_limits<_Tp> |
639 | | { |
640 | | typedef numeric_limits<_Tp> __base; |
641 | | typedef _Tp type; |
642 | | public: |
643 | | static _LIBCPP_CONSTEXPR const bool is_specialized = __base::is_specialized; |
644 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __base::min();} |
645 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __base::max();} |
646 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return __base::lowest();} |
647 | | |
648 | | static _LIBCPP_CONSTEXPR const int digits = __base::digits; |
649 | | static _LIBCPP_CONSTEXPR const int digits10 = __base::digits10; |
650 | | static _LIBCPP_CONSTEXPR const int max_digits10 = __base::max_digits10; |
651 | | static _LIBCPP_CONSTEXPR const bool is_signed = __base::is_signed; |
652 | | static _LIBCPP_CONSTEXPR const bool is_integer = __base::is_integer; |
653 | | static _LIBCPP_CONSTEXPR const bool is_exact = __base::is_exact; |
654 | | static _LIBCPP_CONSTEXPR const int radix = __base::radix; |
655 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return __base::epsilon();} |
656 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return __base::round_error();} |
657 | | |
658 | | static _LIBCPP_CONSTEXPR const int min_exponent = __base::min_exponent; |
659 | | static _LIBCPP_CONSTEXPR const int min_exponent10 = __base::min_exponent10; |
660 | | static _LIBCPP_CONSTEXPR const int max_exponent = __base::max_exponent; |
661 | | static _LIBCPP_CONSTEXPR const int max_exponent10 = __base::max_exponent10; |
662 | | |
663 | | static _LIBCPP_CONSTEXPR const bool has_infinity = __base::has_infinity; |
664 | | static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = __base::has_quiet_NaN; |
665 | | static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = __base::has_signaling_NaN; |
666 | | static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = __base::has_denorm; |
667 | | static _LIBCPP_CONSTEXPR const bool has_denorm_loss = __base::has_denorm_loss; |
668 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return __base::infinity();} |
669 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();} |
670 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();} |
671 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __base::denorm_min();} |
672 | | |
673 | | static _LIBCPP_CONSTEXPR const bool is_iec559 = __base::is_iec559; |
674 | | static _LIBCPP_CONSTEXPR const bool is_bounded = __base::is_bounded; |
675 | | static _LIBCPP_CONSTEXPR const bool is_modulo = __base::is_modulo; |
676 | | |
677 | | static _LIBCPP_CONSTEXPR const bool traps = __base::traps; |
678 | | static _LIBCPP_CONSTEXPR const bool tinyness_before = __base::tinyness_before; |
679 | | static _LIBCPP_CONSTEXPR const float_round_style round_style = __base::round_style; |
680 | | }; |
681 | | |
682 | | template <class _Tp> |
683 | | _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_specialized; |
684 | | template <class _Tp> |
685 | | _LIBCPP_CONSTEXPR const int numeric_limits<volatile _Tp>::digits; |
686 | | template <class _Tp> |
687 | | _LIBCPP_CONSTEXPR const int numeric_limits<volatile _Tp>::digits10; |
688 | | template <class _Tp> |
689 | | _LIBCPP_CONSTEXPR const int numeric_limits<volatile _Tp>::max_digits10; |
690 | | template <class _Tp> |
691 | | _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_signed; |
692 | | template <class _Tp> |
693 | | _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_integer; |
694 | | template <class _Tp> |
695 | | _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_exact; |
696 | | template <class _Tp> |
697 | | _LIBCPP_CONSTEXPR const int numeric_limits<volatile _Tp>::radix; |
698 | | template <class _Tp> |
699 | | _LIBCPP_CONSTEXPR const int numeric_limits<volatile _Tp>::min_exponent; |
700 | | template <class _Tp> |
701 | | _LIBCPP_CONSTEXPR const int numeric_limits<volatile _Tp>::min_exponent10; |
702 | | template <class _Tp> |
703 | | _LIBCPP_CONSTEXPR const int numeric_limits<volatile _Tp>::max_exponent; |
704 | | template <class _Tp> |
705 | | _LIBCPP_CONSTEXPR const int numeric_limits<volatile _Tp>::max_exponent10; |
706 | | template <class _Tp> |
707 | | _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::has_infinity; |
708 | | template <class _Tp> |
709 | | _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::has_quiet_NaN; |
710 | | template <class _Tp> |
711 | | _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::has_signaling_NaN; |
712 | | template <class _Tp> |
713 | | _LIBCPP_CONSTEXPR const float_denorm_style numeric_limits<volatile _Tp>::has_denorm; |
714 | | template <class _Tp> |
715 | | _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::has_denorm_loss; |
716 | | template <class _Tp> |
717 | | _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_iec559; |
718 | | template <class _Tp> |
719 | | _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_bounded; |
720 | | template <class _Tp> |
721 | | _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_modulo; |
722 | | template <class _Tp> |
723 | | _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::traps; |
724 | | template <class _Tp> |
725 | | _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::tinyness_before; |
726 | | template <class _Tp> |
727 | | _LIBCPP_CONSTEXPR const float_round_style numeric_limits<volatile _Tp>::round_style; |
728 | | |
729 | | template <class _Tp> |
730 | | class _LIBCPP_TEMPLATE_VIS numeric_limits<const volatile _Tp> |
731 | | : private numeric_limits<_Tp> |
732 | | { |
733 | | typedef numeric_limits<_Tp> __base; |
734 | | typedef _Tp type; |
735 | | public: |
736 | | static _LIBCPP_CONSTEXPR const bool is_specialized = __base::is_specialized; |
737 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __base::min();} |
738 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __base::max();} |
739 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return __base::lowest();} |
740 | | |
741 | | static _LIBCPP_CONSTEXPR const int digits = __base::digits; |
742 | | static _LIBCPP_CONSTEXPR const int digits10 = __base::digits10; |
743 | | static _LIBCPP_CONSTEXPR const int max_digits10 = __base::max_digits10; |
744 | | static _LIBCPP_CONSTEXPR const bool is_signed = __base::is_signed; |
745 | | static _LIBCPP_CONSTEXPR const bool is_integer = __base::is_integer; |
746 | | static _LIBCPP_CONSTEXPR const bool is_exact = __base::is_exact; |
747 | | static _LIBCPP_CONSTEXPR const int radix = __base::radix; |
748 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return __base::epsilon();} |
749 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return __base::round_error();} |
750 | | |
751 | | static _LIBCPP_CONSTEXPR const int min_exponent = __base::min_exponent; |
752 | | static _LIBCPP_CONSTEXPR const int min_exponent10 = __base::min_exponent10; |
753 | | static _LIBCPP_CONSTEXPR const int max_exponent = __base::max_exponent; |
754 | | static _LIBCPP_CONSTEXPR const int max_exponent10 = __base::max_exponent10; |
755 | | |
756 | | static _LIBCPP_CONSTEXPR const bool has_infinity = __base::has_infinity; |
757 | | static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = __base::has_quiet_NaN; |
758 | | static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = __base::has_signaling_NaN; |
759 | | static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = __base::has_denorm; |
760 | | static _LIBCPP_CONSTEXPR const bool has_denorm_loss = __base::has_denorm_loss; |
761 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return __base::infinity();} |
762 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();} |
763 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();} |
764 | | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __base::denorm_min();} |
765 | | |
766 | | static _LIBCPP_CONSTEXPR const bool is_iec559 = __base::is_iec559; |
767 | | static _LIBCPP_CONSTEXPR const bool is_bounded = __base::is_bounded; |
768 | | static _LIBCPP_CONSTEXPR const bool is_modulo = __base::is_modulo; |
769 | | |
770 | | static _LIBCPP_CONSTEXPR const bool traps = __base::traps; |
771 | | static _LIBCPP_CONSTEXPR const bool tinyness_before = __base::tinyness_before; |
772 | | static _LIBCPP_CONSTEXPR const float_round_style round_style = __base::round_style; |
773 | | }; |
774 | | |
775 | | template <class _Tp> |
776 | | _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_specialized; |
777 | | template <class _Tp> |
778 | | _LIBCPP_CONSTEXPR const int numeric_limits<const volatile _Tp>::digits; |
779 | | template <class _Tp> |
780 | | _LIBCPP_CONSTEXPR const int numeric_limits<const volatile _Tp>::digits10; |
781 | | template <class _Tp> |
782 | | _LIBCPP_CONSTEXPR const int numeric_limits<const volatile _Tp>::max_digits10; |
783 | | template <class _Tp> |
784 | | _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_signed; |
785 | | template <class _Tp> |
786 | | _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_integer; |
787 | | template <class _Tp> |
788 | | _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_exact; |
789 | | template <class _Tp> |
790 | | _LIBCPP_CONSTEXPR const int numeric_limits<const volatile _Tp>::radix; |
791 | | template <class _Tp> |
792 | | _LIBCPP_CONSTEXPR const int numeric_limits<const volatile _Tp>::min_exponent; |
793 | | template <class _Tp> |
794 | | _LIBCPP_CONSTEXPR const int numeric_limits<const volatile _Tp>::min_exponent10; |
795 | | template <class _Tp> |
796 | | _LIBCPP_CONSTEXPR const int numeric_limits<const volatile _Tp>::max_exponent; |
797 | | template <class _Tp> |
798 | | _LIBCPP_CONSTEXPR const int numeric_limits<const volatile _Tp>::max_exponent10; |
799 | | template <class _Tp> |
800 | | _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::has_infinity; |
801 | | template <class _Tp> |
802 | | _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::has_quiet_NaN; |
803 | | template <class _Tp> |
804 | | _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::has_signaling_NaN; |
805 | | template <class _Tp> |
806 | | _LIBCPP_CONSTEXPR const float_denorm_style numeric_limits<const volatile _Tp>::has_denorm; |
807 | | template <class _Tp> |
808 | | _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::has_denorm_loss; |
809 | | template <class _Tp> |
810 | | _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_iec559; |
811 | | template <class _Tp> |
812 | | _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_bounded; |
813 | | template <class _Tp> |
814 | | _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_modulo; |
815 | | template <class _Tp> |
816 | | _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::traps; |
817 | | template <class _Tp> |
818 | | _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::tinyness_before; |
819 | | template <class _Tp> |
820 | | _LIBCPP_CONSTEXPR const float_round_style numeric_limits<const volatile _Tp>::round_style; |
821 | | |
822 | | _LIBCPP_END_NAMESPACE_STD |
823 | | |
824 | | _LIBCPP_POP_MACROS |
825 | | |
826 | | #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 |
827 | | # include <type_traits> |
828 | | #endif |
829 | | |
830 | | #endif // _LIBCPP_LIMITS |