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