]> git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/include/std/limits
*: Use headername alias to associate private includes to public includes.
[thirdparty/gcc.git] / libstdc++-v3 / include / std / limits
1 // The template and inlines for the numeric_limits classes. -*- C++ -*-
2
3 // Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
4 // 2008, 2009, 2010 Free Software Foundation, Inc.
5 //
6 // This file is part of the GNU ISO C++ Library. This library is free
7 // software; you can redistribute it and/or modify it under the
8 // terms of the GNU General Public License as published by the
9 // Free Software Foundation; either version 3, or (at your option)
10 // any later version.
11
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16
17 // Under Section 7 of GPL version 3, you are granted additional
18 // permissions described in the GCC Runtime Library Exception, version
19 // 3.1, as published by the Free Software Foundation.
20
21 // You should have received a copy of the GNU General Public License and
22 // a copy of the GCC Runtime Library Exception along with this program;
23 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24 // <http://www.gnu.org/licenses/>.
25
26 /** @file include/limits
27 * This is a Standard C++ Library header.
28 */
29
30 // Note: this is not a conforming implementation.
31 // Written by Gabriel Dos Reis <gdr@codesourcery.com>
32
33 //
34 // ISO 14882:1998
35 // 18.2.1
36 //
37
38 #ifndef _GLIBCXX_NUMERIC_LIMITS
39 #define _GLIBCXX_NUMERIC_LIMITS 1
40
41 #pragma GCC system_header
42
43 #include <bits/c++config.h>
44
45 //
46 // The numeric_limits<> traits document implementation-defined aspects
47 // of fundamental arithmetic data types (integers and floating points).
48 // From Standard C++ point of view, there are 14 such types:
49 // * integers
50 // bool (1)
51 // char, signed char, unsigned char, wchar_t (4)
52 // short, unsigned short (2)
53 // int, unsigned (2)
54 // long, unsigned long (2)
55 //
56 // * floating points
57 // float (1)
58 // double (1)
59 // long double (1)
60 //
61 // GNU C++ understands (where supported by the host C-library)
62 // * integer
63 // long long, unsigned long long (2)
64 //
65 // which brings us to 16 fundamental arithmetic data types in GNU C++.
66 //
67 //
68 // Since a numeric_limits<> is a bit tricky to get right, we rely on
69 // an interface composed of macros which should be defined in config/os
70 // or config/cpu when they differ from the generic (read arbitrary)
71 // definitions given here.
72 //
73
74 // These values can be overridden in the target configuration file.
75 // The default values are appropriate for many 32-bit targets.
76
77 // GCC only intrinsically supports modulo integral types. The only remaining
78 // integral exceptional values is division by zero. Only targets that do not
79 // signal division by zero in some "hard to ignore" way should use false.
80 #ifndef __glibcxx_integral_traps
81 # define __glibcxx_integral_traps true
82 #endif
83
84 // float
85 //
86
87 // Default values. Should be overridden in configuration files if necessary.
88
89 #ifndef __glibcxx_float_has_denorm_loss
90 # define __glibcxx_float_has_denorm_loss false
91 #endif
92 #ifndef __glibcxx_float_traps
93 # define __glibcxx_float_traps false
94 #endif
95 #ifndef __glibcxx_float_tinyness_before
96 # define __glibcxx_float_tinyness_before false
97 #endif
98
99 // double
100
101 // Default values. Should be overridden in configuration files if necessary.
102
103 #ifndef __glibcxx_double_has_denorm_loss
104 # define __glibcxx_double_has_denorm_loss false
105 #endif
106 #ifndef __glibcxx_double_traps
107 # define __glibcxx_double_traps false
108 #endif
109 #ifndef __glibcxx_double_tinyness_before
110 # define __glibcxx_double_tinyness_before false
111 #endif
112
113 // long double
114
115 // Default values. Should be overridden in configuration files if necessary.
116
117 #ifndef __glibcxx_long_double_has_denorm_loss
118 # define __glibcxx_long_double_has_denorm_loss false
119 #endif
120 #ifndef __glibcxx_long_double_traps
121 # define __glibcxx_long_double_traps false
122 #endif
123 #ifndef __glibcxx_long_double_tinyness_before
124 # define __glibcxx_long_double_tinyness_before false
125 #endif
126
127 // You should not need to define any macros below this point.
128
129 #define __glibcxx_signed(T) ((T)(-1) < 0)
130
131 #define __glibcxx_min(T) \
132 (__glibcxx_signed (T) ? (T)1 << __glibcxx_digits (T) : (T)0)
133
134 #define __glibcxx_max(T) \
135 (__glibcxx_signed (T) ? \
136 (((((T)1 << (__glibcxx_digits (T) - 1)) - 1) << 1) + 1) : ~(T)0)
137
138 #define __glibcxx_digits(T) \
139 (sizeof(T) * __CHAR_BIT__ - __glibcxx_signed (T))
140
141 // The fraction 643/2136 approximates log10(2) to 7 significant digits.
142 #define __glibcxx_digits10(T) \
143 (__glibcxx_digits (T) * 643L / 2136)
144
145 #define __glibcxx_max_digits10(T) \
146 (2 + (T) * 643L / 2136)
147
148 _GLIBCXX_BEGIN_NAMESPACE(std)
149
150 /**
151 * @brief Describes the rounding style for floating-point types.
152 *
153 * This is used in the std::numeric_limits class.
154 */
155 enum float_round_style
156 {
157 round_indeterminate = -1, /// Intermediate.
158 round_toward_zero = 0, /// To zero.
159 round_to_nearest = 1, /// To the nearest representable value.
160 round_toward_infinity = 2, /// To infinity.
161 round_toward_neg_infinity = 3 /// To negative infinity.
162 };
163
164 /**
165 * @brief Describes the denormalization for floating-point types.
166 *
167 * These values represent the presence or absence of a variable number
168 * of exponent bits. This type is used in the std::numeric_limits class.
169 */
170 enum float_denorm_style
171 {
172 /// Indeterminate at compile time whether denormalized values are allowed.
173 denorm_indeterminate = -1,
174 /// The type does not allow denormalized values.
175 denorm_absent = 0,
176 /// The type allows denormalized values.
177 denorm_present = 1
178 };
179
180 /**
181 * @brief Part of std::numeric_limits.
182 *
183 * The @c static @c const members are usable as integral constant
184 * expressions.
185 *
186 * @note This is a separate class for purposes of efficiency; you
187 * should only access these members as part of an instantiation
188 * of the std::numeric_limits class.
189 */
190 struct __numeric_limits_base
191 {
192 /** This will be true for all fundamental types (which have
193 specializations), and false for everything else. */
194 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = false;
195
196 /** The number of @c radix digits that be represented without change: for
197 integer types, the number of non-sign bits in the mantissa; for
198 floating types, the number of @c radix digits in the mantissa. */
199 static _GLIBCXX_USE_CONSTEXPR int digits = 0;
200
201 /** The number of base 10 digits that can be represented without change. */
202 static _GLIBCXX_USE_CONSTEXPR int digits10 = 0;
203
204 #ifdef __GXX_EXPERIMENTAL_CXX0X__
205 /** The number of base 10 digits required to ensure that values which
206 differ are always differentiated. */
207 static constexpr int max_digits10 = 0;
208 #endif
209
210 /** True if the type is signed. */
211 static _GLIBCXX_USE_CONSTEXPR bool is_signed = false;
212
213 /** True if the type is integer.
214 * Is this supposed to be <em>if the type is integral?</em> */
215 static _GLIBCXX_USE_CONSTEXPR bool is_integer = false;
216
217 /** True if the type uses an exact representation. <em>All integer types are
218 exact, but not all exact types are integer. For example, rational and
219 fixed-exponent representations are exact but not integer.</em>
220 [18.2.1.2]/15 */
221 static _GLIBCXX_USE_CONSTEXPR bool is_exact = false;
222
223 /** For integer types, specifies the base of the representation. For
224 floating types, specifies the base of the exponent representation. */
225 static _GLIBCXX_USE_CONSTEXPR int radix = 0;
226
227 /** The minimum negative integer such that @c radix raised to the power of
228 (one less than that integer) is a normalized floating point number. */
229 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
230
231 /** The minimum negative integer such that 10 raised to that power is in
232 the range of normalized floating point numbers. */
233 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0;
234
235 /** The maximum positive integer such that @c radix raised to the power of
236 (one less than that integer) is a representable finite floating point
237 number. */
238 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0;
239
240 /** The maximum positive integer such that 10 raised to that power is in
241 the range of representable finite floating point numbers. */
242 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0;
243
244 /** True if the type has a representation for positive infinity. */
245 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false;
246
247 /** True if the type has a representation for a quiet (non-signaling)
248 <em>Not a Number</em>. */
249 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false;
250
251 /** True if the type has a representation for a signaling
252 <em>Not a Number</em>. */
253 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false;
254
255 /** See std::float_denorm_style for more information. */
256 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm = denorm_absent;
257
258 /** <em>True if loss of accuracy is detected as a denormalization loss,
259 rather than as an inexact result.</em> [18.2.1.2]/42 */
260 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
261
262 /** True if-and-only-if the type adheres to the IEC 559 standard, also
263 known as IEEE 754. (Only makes sense for floating point types.) */
264 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
265
266 /** <em>True if the set of values representable by the type is
267 finite. All built-in types are bounded, this member would be
268 false for arbitrary precision types.</em> [18.2.1.2]/54 */
269 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = false;
270
271 /** True if the type is @e modulo, that is, if it is possible to add two
272 positive numbers and have a result that wraps around to a third number
273 that is less. Typically false for floating types, true for unsigned
274 integers, and true for signed integers. */
275 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false;
276
277 /** True if trapping is implemented for this type. */
278 static _GLIBCXX_USE_CONSTEXPR bool traps = false;
279
280 /** True if tininess is detected before rounding. (see IEC 559) */
281 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;
282
283 /** See std::float_round_style for more information. This is only
284 meaningful for floating types; integer types will all be
285 round_toward_zero. */
286 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style =
287 round_toward_zero;
288 };
289
290 /**
291 * @brief Properties of fundamental types.
292 *
293 * This class allows a program to obtain information about the
294 * representation of a fundamental type on a given platform. For
295 * non-fundamental types, the functions will return 0 and the data
296 * members will all be @c false.
297 *
298 * _GLIBCXX_RESOLVE_LIB_DEFECTS: DRs 201 and 184 (hi Gaby!) are
299 * noted, but not incorporated in this documented (yet).
300 */
301 template<typename _Tp>
302 struct numeric_limits : public __numeric_limits_base
303 {
304 /** The minimum finite value, or for floating types with
305 denormalization, the minimum positive normalized value. */
306 static _GLIBCXX_CONSTEXPR _Tp
307 min() throw() { return static_cast<_Tp>(0); }
308
309 /** The maximum finite value. */
310 static _GLIBCXX_CONSTEXPR _Tp
311 max() throw() { return static_cast<_Tp>(0); }
312
313 #ifdef __GXX_EXPERIMENTAL_CXX0X__
314 /** A finite value x such that there is no other finite value y
315 * where y < x. */
316 static constexpr _Tp
317 lowest() throw() { return static_cast<_Tp>(0); }
318 #endif
319
320 /** The @e machine @e epsilon: the difference between 1 and the least
321 value greater than 1 that is representable. */
322 static _GLIBCXX_CONSTEXPR _Tp
323 epsilon() throw() { return static_cast<_Tp>(0); }
324
325 /** The maximum rounding error measurement (see LIA-1). */
326 static _GLIBCXX_CONSTEXPR _Tp
327 round_error() throw() { return static_cast<_Tp>(0); }
328
329 /** The representation of positive infinity, if @c has_infinity. */
330 static _GLIBCXX_CONSTEXPR _Tp
331 infinity() throw() { return static_cast<_Tp>(0); }
332
333 /** The representation of a quiet <em>Not a Number</em>,
334 if @c has_quiet_NaN. */
335 static _GLIBCXX_CONSTEXPR _Tp
336 quiet_NaN() throw() { return static_cast<_Tp>(0); }
337
338 /** The representation of a signaling <em>Not a Number</em>, if
339 @c has_signaling_NaN. */
340 static _GLIBCXX_CONSTEXPR _Tp
341 signaling_NaN() throw() { return static_cast<_Tp>(0); }
342
343 /** The minimum positive denormalized value. For types where
344 @c has_denorm is false, this is the minimum positive normalized
345 value. */
346 static _GLIBCXX_CONSTEXPR _Tp
347 denorm_min() throw() { return static_cast<_Tp>(0); }
348 };
349
350 #ifdef __GXX_EXPERIMENTAL_CXX0X__
351 template<typename _Tp>
352 struct numeric_limits<const _Tp>
353 : public numeric_limits<_Tp> { };
354
355 template<typename _Tp>
356 struct numeric_limits<volatile _Tp>
357 : public numeric_limits<_Tp> { };
358
359 template<typename _Tp>
360 struct numeric_limits<const volatile _Tp>
361 : public numeric_limits<_Tp> { };
362 #endif
363
364 // Now there follow 16 explicit specializations. Yes, 16. Make sure
365 // you get the count right. (18 in c++0x mode)
366
367 /// numeric_limits<bool> specialization.
368 template<>
369 struct numeric_limits<bool>
370 {
371 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
372
373 static _GLIBCXX_CONSTEXPR bool
374 min() throw() { return false; }
375
376 static _GLIBCXX_CONSTEXPR bool
377 max() throw() { return true; }
378
379 #ifdef __GXX_EXPERIMENTAL_CXX0X__
380 static constexpr bool
381 lowest() throw() { return min(); }
382 #endif
383 static _GLIBCXX_USE_CONSTEXPR int digits = 1;
384 static _GLIBCXX_USE_CONSTEXPR int digits10 = 0;
385 #ifdef __GXX_EXPERIMENTAL_CXX0X__
386 static constexpr int max_digits10 = 0;
387 #endif
388 static _GLIBCXX_USE_CONSTEXPR bool is_signed = false;
389 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true;
390 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true;
391 static _GLIBCXX_USE_CONSTEXPR int radix = 2;
392
393 static _GLIBCXX_CONSTEXPR bool
394 epsilon() throw() { return false; }
395
396 static _GLIBCXX_CONSTEXPR bool
397 round_error() throw() { return false; }
398
399 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
400 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0;
401 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0;
402 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0;
403
404 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false;
405 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false;
406 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false;
407 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
408 = denorm_absent;
409 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
410
411 static _GLIBCXX_CONSTEXPR bool
412 infinity() throw() { return false; }
413
414 static _GLIBCXX_CONSTEXPR bool
415 quiet_NaN() throw() { return false; }
416
417 static _GLIBCXX_CONSTEXPR bool
418 signaling_NaN() throw() { return false; }
419
420 static _GLIBCXX_CONSTEXPR bool
421 denorm_min() throw() { return false; }
422
423 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
424 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
425 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false;
426
427 // It is not clear what it means for a boolean type to trap.
428 // This is a DR on the LWG issue list. Here, I use integer
429 // promotion semantics.
430 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps;
431 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;
432 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
433 = round_toward_zero;
434 };
435
436 /// numeric_limits<char> specialization.
437 template<>
438 struct numeric_limits<char>
439 {
440 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
441
442 static _GLIBCXX_CONSTEXPR char
443 min() throw() { return __glibcxx_min(char); }
444
445 static _GLIBCXX_CONSTEXPR char
446 max() throw() { return __glibcxx_max(char); }
447
448 #ifdef __GXX_EXPERIMENTAL_CXX0X__
449 static constexpr char
450 lowest() throw() { return min(); }
451 #endif
452
453 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (char);
454 static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (char);
455 #ifdef __GXX_EXPERIMENTAL_CXX0X__
456 static constexpr int max_digits10 = 0;
457 #endif
458 static _GLIBCXX_USE_CONSTEXPR bool is_signed = __glibcxx_signed (char);
459 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true;
460 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true;
461 static _GLIBCXX_USE_CONSTEXPR int radix = 2;
462
463 static _GLIBCXX_CONSTEXPR char
464 epsilon() throw() { return 0; }
465
466 static _GLIBCXX_CONSTEXPR char
467 round_error() throw() { return 0; }
468
469 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
470 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0;
471 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0;
472 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0;
473
474 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false;
475 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false;
476 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false;
477 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
478 = denorm_absent;
479 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
480
481 static _GLIBCXX_CONSTEXPR
482 char infinity() throw() { return char(); }
483
484 static _GLIBCXX_CONSTEXPR char
485 quiet_NaN() throw() { return char(); }
486
487 static _GLIBCXX_CONSTEXPR char
488 signaling_NaN() throw() { return char(); }
489
490 static _GLIBCXX_CONSTEXPR char
491 denorm_min() throw() { return static_cast<char>(0); }
492
493 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
494 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
495 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true;
496
497 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps;
498 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;
499 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
500 = round_toward_zero;
501 };
502
503 /// numeric_limits<signed char> specialization.
504 template<>
505 struct numeric_limits<signed char>
506 {
507 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
508
509 static _GLIBCXX_CONSTEXPR signed char
510 min() throw() { return -__SCHAR_MAX__ - 1; }
511
512 static _GLIBCXX_CONSTEXPR signed char
513 max() throw() { return __SCHAR_MAX__; }
514
515 #ifdef __GXX_EXPERIMENTAL_CXX0X__
516 static constexpr signed char
517 lowest() throw() { return min(); }
518 #endif
519
520 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (signed char);
521 static _GLIBCXX_USE_CONSTEXPR int digits10
522 = __glibcxx_digits10 (signed char);
523 #ifdef __GXX_EXPERIMENTAL_CXX0X__
524 static constexpr int max_digits10 = 0;
525 #endif
526 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true;
527 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true;
528 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true;
529 static _GLIBCXX_USE_CONSTEXPR int radix = 2;
530
531 static _GLIBCXX_CONSTEXPR signed char
532 epsilon() throw() { return 0; }
533
534 static _GLIBCXX_CONSTEXPR signed char
535 round_error() throw() { return 0; }
536
537 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
538 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0;
539 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0;
540 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0;
541
542 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false;
543 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false;
544 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false;
545 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
546 = denorm_absent;
547 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
548
549 static _GLIBCXX_CONSTEXPR signed char
550 infinity() throw() { return static_cast<signed char>(0); }
551
552 static _GLIBCXX_CONSTEXPR signed char
553 quiet_NaN() throw() { return static_cast<signed char>(0); }
554
555 static _GLIBCXX_CONSTEXPR signed char
556 signaling_NaN() throw() { return static_cast<signed char>(0); }
557
558 static _GLIBCXX_CONSTEXPR signed char
559 denorm_min() throw() { return static_cast<signed char>(0); }
560
561 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
562 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
563 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true;
564
565 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps;
566 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;
567 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
568 = round_toward_zero;
569 };
570
571 /// numeric_limits<unsigned char> specialization.
572 template<>
573 struct numeric_limits<unsigned char>
574 {
575 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
576
577 static _GLIBCXX_CONSTEXPR unsigned char
578 min() throw() { return 0; }
579
580 static _GLIBCXX_CONSTEXPR unsigned char
581 max() throw() { return __SCHAR_MAX__ * 2U + 1; }
582
583 #ifdef __GXX_EXPERIMENTAL_CXX0X__
584 static constexpr unsigned char
585 lowest() throw() { return min(); }
586 #endif
587
588 static _GLIBCXX_USE_CONSTEXPR int digits
589 = __glibcxx_digits (unsigned char);
590 static _GLIBCXX_USE_CONSTEXPR int digits10
591 = __glibcxx_digits10 (unsigned char);
592 #ifdef __GXX_EXPERIMENTAL_CXX0X__
593 static constexpr int max_digits10 = 0;
594 #endif
595 static _GLIBCXX_USE_CONSTEXPR bool is_signed = false;
596 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true;
597 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true;
598 static _GLIBCXX_USE_CONSTEXPR int radix = 2;
599
600 static _GLIBCXX_CONSTEXPR unsigned char
601 epsilon() throw() { return 0; }
602
603 static _GLIBCXX_CONSTEXPR unsigned char
604 round_error() throw() { return 0; }
605
606 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
607 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0;
608 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0;
609 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0;
610
611 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false;
612 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false;
613 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false;
614 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
615 = denorm_absent;
616 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
617
618 static _GLIBCXX_CONSTEXPR unsigned char
619 infinity() throw() { return static_cast<unsigned char>(0); }
620
621 static _GLIBCXX_CONSTEXPR unsigned char
622 quiet_NaN() throw() { return static_cast<unsigned char>(0); }
623
624 static _GLIBCXX_CONSTEXPR unsigned char
625 signaling_NaN() throw() { return static_cast<unsigned char>(0); }
626
627 static _GLIBCXX_CONSTEXPR unsigned char
628 denorm_min() throw() { return static_cast<unsigned char>(0); }
629
630 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
631 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
632 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true;
633
634 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps;
635 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;
636 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
637 = round_toward_zero;
638 };
639
640 /// numeric_limits<wchar_t> specialization.
641 template<>
642 struct numeric_limits<wchar_t>
643 {
644 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
645
646 static _GLIBCXX_CONSTEXPR wchar_t
647 min() throw() { return __glibcxx_min (wchar_t); }
648
649 static _GLIBCXX_CONSTEXPR wchar_t
650 max() throw() { return __glibcxx_max (wchar_t); }
651
652 #ifdef __GXX_EXPERIMENTAL_CXX0X__
653 static constexpr wchar_t
654 lowest() throw() { return min(); }
655 #endif
656
657 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (wchar_t);
658 static _GLIBCXX_USE_CONSTEXPR int digits10
659 = __glibcxx_digits10 (wchar_t);
660 #ifdef __GXX_EXPERIMENTAL_CXX0X__
661 static constexpr int max_digits10 = 0;
662 #endif
663 static _GLIBCXX_USE_CONSTEXPR bool is_signed = __glibcxx_signed (wchar_t);
664 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true;
665 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true;
666 static _GLIBCXX_USE_CONSTEXPR int radix = 2;
667
668 static _GLIBCXX_CONSTEXPR wchar_t
669 epsilon() throw() { return 0; }
670
671 static _GLIBCXX_CONSTEXPR wchar_t
672 round_error() throw() { return 0; }
673
674 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
675 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0;
676 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0;
677 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0;
678
679 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false;
680 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false;
681 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false;
682 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
683 = denorm_absent;
684 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
685
686 static _GLIBCXX_CONSTEXPR wchar_t
687 infinity() throw() { return wchar_t(); }
688
689 static _GLIBCXX_CONSTEXPR wchar_t
690 quiet_NaN() throw() { return wchar_t(); }
691
692 static _GLIBCXX_CONSTEXPR wchar_t
693 signaling_NaN() throw() { return wchar_t(); }
694
695 static _GLIBCXX_CONSTEXPR wchar_t
696 denorm_min() throw() { return wchar_t(); }
697
698 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
699 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
700 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true;
701
702 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps;
703 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;
704 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
705 = round_toward_zero;
706 };
707
708 #ifdef __GXX_EXPERIMENTAL_CXX0X__
709 /// numeric_limits<char16_t> specialization.
710 template<>
711 struct numeric_limits<char16_t>
712 {
713 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
714
715 static _GLIBCXX_CONSTEXPR char16_t
716 min() throw() { return __glibcxx_min (char16_t); }
717
718 static _GLIBCXX_CONSTEXPR char16_t
719 max() throw() { return __glibcxx_max (char16_t); }
720
721 #ifdef __GXX_EXPERIMENTAL_CXX0X__
722 static constexpr char16_t
723 lowest() throw() { return min(); }
724 #endif
725
726 static _GLIBCXX_USE_CONSTEXPR int digits
727 = __glibcxx_digits (char16_t);
728 static _GLIBCXX_USE_CONSTEXPR int digits10
729 = __glibcxx_digits10 (char16_t);
730 #ifdef __GXX_EXPERIMENTAL_CXX0X__
731 static constexpr int max_digits10 = 0;
732 #endif
733 static _GLIBCXX_USE_CONSTEXPR bool is_signed
734 = __glibcxx_signed (char16_t);
735 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true;
736 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true;
737 static _GLIBCXX_USE_CONSTEXPR int radix = 2;
738
739 static _GLIBCXX_CONSTEXPR char16_t
740 epsilon() throw() { return 0; }
741
742 static _GLIBCXX_CONSTEXPR char16_t
743 round_error() throw() { return 0; }
744
745 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
746 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0;
747 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0;
748 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0;
749
750 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false;
751 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false;
752 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false;
753 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
754 = denorm_absent;
755 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
756
757 static _GLIBCXX_CONSTEXPR char16_t
758 infinity() throw() { return char16_t(); }
759
760 static _GLIBCXX_CONSTEXPR char16_t
761 quiet_NaN() throw() { return char16_t(); }
762
763 static _GLIBCXX_CONSTEXPR char16_t
764 signaling_NaN() throw() { return char16_t(); }
765
766 static _GLIBCXX_CONSTEXPR char16_t
767 denorm_min() throw() { return char16_t(); }
768
769 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
770 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
771 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true;
772
773 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps;
774 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;
775 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
776 = round_toward_zero;
777 };
778
779 /// numeric_limits<char32_t> specialization.
780 template<>
781 struct numeric_limits<char32_t>
782 {
783 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
784
785 static _GLIBCXX_CONSTEXPR char32_t
786 min() throw() { return __glibcxx_min (char32_t); }
787
788 static _GLIBCXX_CONSTEXPR char32_t
789 max() throw() { return __glibcxx_max (char32_t); }
790
791 #ifdef __GXX_EXPERIMENTAL_CXX0X__
792 static constexpr char32_t
793 lowest() throw() { return min(); }
794 #endif
795
796 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (char32_t);
797 static _GLIBCXX_USE_CONSTEXPR int digits10
798 = __glibcxx_digits10 (char32_t);
799 #ifdef __GXX_EXPERIMENTAL_CXX0X__
800 static constexpr int max_digits10 = 0;
801 #endif
802 static _GLIBCXX_USE_CONSTEXPR bool is_signed
803 = __glibcxx_signed (char32_t);
804 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true;
805 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true;
806 static _GLIBCXX_USE_CONSTEXPR int radix = 2;
807
808 static _GLIBCXX_CONSTEXPR char32_t
809 epsilon() throw() { return 0; }
810
811 static _GLIBCXX_CONSTEXPR char32_t
812 round_error() throw() { return 0; }
813
814 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
815 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0;
816 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0;
817 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0;
818
819 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false;
820 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false;
821 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false;
822 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
823 = denorm_absent;
824 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
825
826 static _GLIBCXX_CONSTEXPR char32_t
827 infinity() throw() { return char32_t(); }
828
829 static _GLIBCXX_CONSTEXPR char32_t
830 quiet_NaN() throw() { return char32_t(); }
831
832 static _GLIBCXX_CONSTEXPR char32_t
833 signaling_NaN() throw() { return char32_t(); }
834
835 static _GLIBCXX_CONSTEXPR char32_t
836 denorm_min() throw() { return char32_t(); }
837
838 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
839 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
840 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true;
841
842 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps;
843 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;
844 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
845 = round_toward_zero;
846 };
847 #endif
848
849 /// numeric_limits<short> specialization.
850 template<>
851 struct numeric_limits<short>
852 {
853 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
854
855 static _GLIBCXX_CONSTEXPR short
856 min() throw() { return -__SHRT_MAX__ - 1; }
857
858 static _GLIBCXX_CONSTEXPR short
859 max() throw() { return __SHRT_MAX__; }
860
861 #ifdef __GXX_EXPERIMENTAL_CXX0X__
862 static constexpr short
863 lowest() throw() { return min(); }
864 #endif
865
866 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (short);
867 static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (short);
868 #ifdef __GXX_EXPERIMENTAL_CXX0X__
869 static constexpr int max_digits10 = 0;
870 #endif
871 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true;
872 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true;
873 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true;
874 static _GLIBCXX_USE_CONSTEXPR int radix = 2;
875
876 static _GLIBCXX_CONSTEXPR short
877 epsilon() throw() { return 0; }
878
879 static _GLIBCXX_CONSTEXPR short
880 round_error() throw() { return 0; }
881
882 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
883 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0;
884 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0;
885 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0;
886
887 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false;
888 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false;
889 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false;
890 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
891 = denorm_absent;
892 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
893
894 static _GLIBCXX_CONSTEXPR short
895 infinity() throw() { return short(); }
896
897 static _GLIBCXX_CONSTEXPR short
898 quiet_NaN() throw() { return short(); }
899
900 static _GLIBCXX_CONSTEXPR short
901 signaling_NaN() throw() { return short(); }
902
903 static _GLIBCXX_CONSTEXPR short
904 denorm_min() throw() { return short(); }
905
906 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
907 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
908 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true;
909
910 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps;
911 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;
912 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
913 = round_toward_zero;
914 };
915
916 /// numeric_limits<unsigned short> specialization.
917 template<>
918 struct numeric_limits<unsigned short>
919 {
920 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
921
922 static _GLIBCXX_CONSTEXPR unsigned short
923 min() throw() { return 0; }
924
925 static _GLIBCXX_CONSTEXPR unsigned short
926 max() throw() { return __SHRT_MAX__ * 2U + 1; }
927
928 #ifdef __GXX_EXPERIMENTAL_CXX0X__
929 static constexpr unsigned short
930 lowest() throw() { return min(); }
931 #endif
932
933 static _GLIBCXX_USE_CONSTEXPR int digits
934 = __glibcxx_digits (unsigned short);
935 static _GLIBCXX_USE_CONSTEXPR int digits10
936 = __glibcxx_digits10 (unsigned short);
937 #ifdef __GXX_EXPERIMENTAL_CXX0X__
938 static constexpr int max_digits10 = 0;
939 #endif
940 static _GLIBCXX_USE_CONSTEXPR bool is_signed = false;
941 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true;
942 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true;
943 static _GLIBCXX_USE_CONSTEXPR int radix = 2;
944
945 static _GLIBCXX_CONSTEXPR unsigned short
946 epsilon() throw() { return 0; }
947
948 static _GLIBCXX_CONSTEXPR unsigned short
949 round_error() throw() { return 0; }
950
951 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
952 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0;
953 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0;
954 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0;
955
956 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false;
957 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false;
958 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false;
959 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
960 = denorm_absent;
961 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
962
963 static _GLIBCXX_CONSTEXPR unsigned short
964 infinity() throw() { return static_cast<unsigned short>(0); }
965
966 static _GLIBCXX_CONSTEXPR unsigned short
967 quiet_NaN() throw() { return static_cast<unsigned short>(0); }
968
969 static _GLIBCXX_CONSTEXPR unsigned short
970 signaling_NaN() throw() { return static_cast<unsigned short>(0); }
971
972 static _GLIBCXX_CONSTEXPR unsigned short
973 denorm_min() throw() { return static_cast<unsigned short>(0); }
974
975 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
976 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
977 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true;
978
979 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps;
980 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;
981 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
982 = round_toward_zero;
983 };
984
985 /// numeric_limits<int> specialization.
986 template<>
987 struct numeric_limits<int>
988 {
989 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
990
991 static _GLIBCXX_CONSTEXPR int
992 min() throw() { return -__INT_MAX__ - 1; }
993
994 static _GLIBCXX_CONSTEXPR int
995 max() throw() { return __INT_MAX__; }
996
997 #ifdef __GXX_EXPERIMENTAL_CXX0X__
998 static constexpr int
999 lowest() throw() { return min(); }
1000 #endif
1001
1002 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (int);
1003 static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (int);
1004 #ifdef __GXX_EXPERIMENTAL_CXX0X__
1005 static constexpr int max_digits10 = 0;
1006 #endif
1007 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true;
1008 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true;
1009 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true;
1010 static _GLIBCXX_USE_CONSTEXPR int radix = 2;
1011
1012 static _GLIBCXX_CONSTEXPR int
1013 epsilon() throw() { return 0; }
1014
1015 static _GLIBCXX_CONSTEXPR int
1016 round_error() throw() { return 0; }
1017
1018 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
1019 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0;
1020 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0;
1021 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0;
1022
1023 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false;
1024 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false;
1025 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false;
1026 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
1027 = denorm_absent;
1028 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
1029
1030 static _GLIBCXX_CONSTEXPR int
1031 infinity() throw() { return static_cast<int>(0); }
1032
1033 static _GLIBCXX_CONSTEXPR int
1034 quiet_NaN() throw() { return static_cast<int>(0); }
1035
1036 static _GLIBCXX_CONSTEXPR int
1037 signaling_NaN() throw() { return static_cast<int>(0); }
1038
1039 static _GLIBCXX_CONSTEXPR int
1040 denorm_min() throw() { return static_cast<int>(0); }
1041
1042 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
1043 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
1044 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true;
1045
1046 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps;
1047 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;
1048 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
1049 = round_toward_zero;
1050 };
1051
1052 /// numeric_limits<unsigned int> specialization.
1053 template<>
1054 struct numeric_limits<unsigned int>
1055 {
1056 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
1057
1058 static _GLIBCXX_CONSTEXPR unsigned int
1059 min() throw() { return 0; }
1060
1061 static _GLIBCXX_CONSTEXPR unsigned int
1062 max() throw() { return __INT_MAX__ * 2U + 1; }
1063
1064 #ifdef __GXX_EXPERIMENTAL_CXX0X__
1065 static constexpr unsigned int
1066 lowest() throw() { return min(); }
1067 #endif
1068
1069 static _GLIBCXX_USE_CONSTEXPR int digits
1070 = __glibcxx_digits (unsigned int);
1071 static _GLIBCXX_USE_CONSTEXPR int digits10
1072 = __glibcxx_digits10 (unsigned int);
1073 #ifdef __GXX_EXPERIMENTAL_CXX0X__
1074 static constexpr int max_digits10 = 0;
1075 #endif
1076 static _GLIBCXX_USE_CONSTEXPR bool is_signed = false;
1077 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true;
1078 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true;
1079 static _GLIBCXX_USE_CONSTEXPR int radix = 2;
1080
1081 static _GLIBCXX_CONSTEXPR unsigned int
1082 epsilon() throw() { return 0; }
1083
1084 static _GLIBCXX_CONSTEXPR unsigned int
1085 round_error() throw() { return 0; }
1086
1087 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
1088 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0;
1089 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0;
1090 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0;
1091
1092 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false;
1093 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false;
1094 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false;
1095 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
1096 = denorm_absent;
1097 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
1098
1099 static _GLIBCXX_CONSTEXPR unsigned int
1100 infinity() throw() { return static_cast<unsigned int>(0); }
1101
1102 static _GLIBCXX_CONSTEXPR unsigned int
1103 quiet_NaN() throw() { return static_cast<unsigned int>(0); }
1104
1105 static _GLIBCXX_CONSTEXPR unsigned int
1106 signaling_NaN() throw() { return static_cast<unsigned int>(0); }
1107
1108 static _GLIBCXX_CONSTEXPR unsigned int
1109 denorm_min() throw() { return static_cast<unsigned int>(0); }
1110
1111 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
1112 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
1113 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true;
1114
1115 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps;
1116 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;
1117 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
1118 = round_toward_zero;
1119 };
1120
1121 /// numeric_limits<long> specialization.
1122 template<>
1123 struct numeric_limits<long>
1124 {
1125 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
1126
1127 static _GLIBCXX_CONSTEXPR long
1128 min() throw() { return -__LONG_MAX__ - 1; }
1129
1130 static _GLIBCXX_CONSTEXPR long
1131 max() throw() { return __LONG_MAX__; }
1132
1133 #ifdef __GXX_EXPERIMENTAL_CXX0X__
1134 static constexpr long
1135 lowest() throw() { return min(); }
1136 #endif
1137
1138 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (long);
1139 static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (long);
1140 #ifdef __GXX_EXPERIMENTAL_CXX0X__
1141 static constexpr int max_digits10 = 0;
1142 #endif
1143 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true;
1144 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true;
1145 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true;
1146 static _GLIBCXX_USE_CONSTEXPR int radix = 2;
1147
1148 static _GLIBCXX_CONSTEXPR long
1149 epsilon() throw() { return 0; }
1150
1151 static _GLIBCXX_CONSTEXPR long
1152 round_error() throw() { return 0; }
1153
1154 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
1155 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0;
1156 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0;
1157 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0;
1158
1159 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false;
1160 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false;
1161 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false;
1162 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
1163 = denorm_absent;
1164 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
1165
1166 static _GLIBCXX_CONSTEXPR long
1167 infinity() throw() { return static_cast<long>(0); }
1168
1169 static _GLIBCXX_CONSTEXPR long
1170 quiet_NaN() throw() { return static_cast<long>(0); }
1171
1172 static _GLIBCXX_CONSTEXPR long
1173 signaling_NaN() throw() { return static_cast<long>(0); }
1174
1175 static _GLIBCXX_CONSTEXPR long
1176 denorm_min() throw() { return static_cast<long>(0); }
1177
1178 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
1179 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
1180 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true;
1181
1182 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps;
1183 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;
1184 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
1185 = round_toward_zero;
1186 };
1187
1188 /// numeric_limits<unsigned long> specialization.
1189 template<>
1190 struct numeric_limits<unsigned long>
1191 {
1192 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
1193
1194 static _GLIBCXX_CONSTEXPR unsigned long
1195 min() throw() { return 0; }
1196
1197 static _GLIBCXX_CONSTEXPR unsigned long
1198 max() throw() { return __LONG_MAX__ * 2UL + 1; }
1199
1200 #ifdef __GXX_EXPERIMENTAL_CXX0X__
1201 static constexpr unsigned long
1202 lowest() throw() { return min(); }
1203 #endif
1204
1205 static _GLIBCXX_USE_CONSTEXPR int digits
1206 = __glibcxx_digits (unsigned long);
1207 static _GLIBCXX_USE_CONSTEXPR int digits10
1208 = __glibcxx_digits10 (unsigned long);
1209 #ifdef __GXX_EXPERIMENTAL_CXX0X__
1210 static constexpr int max_digits10 = 0;
1211 #endif
1212 static _GLIBCXX_USE_CONSTEXPR bool is_signed = false;
1213 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true;
1214 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true;
1215 static _GLIBCXX_USE_CONSTEXPR int radix = 2;
1216
1217 static _GLIBCXX_CONSTEXPR unsigned long
1218 epsilon() throw() { return 0; }
1219
1220 static _GLIBCXX_CONSTEXPR unsigned long
1221 round_error() throw() { return 0; }
1222
1223 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
1224 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0;
1225 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0;
1226 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0;
1227
1228 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false;
1229 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false;
1230 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false;
1231 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
1232 = denorm_absent;
1233 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
1234
1235 static _GLIBCXX_CONSTEXPR unsigned long
1236 infinity() throw() { return static_cast<unsigned long>(0); }
1237
1238 static _GLIBCXX_CONSTEXPR unsigned long
1239 quiet_NaN() throw() { return static_cast<unsigned long>(0); }
1240
1241 static _GLIBCXX_CONSTEXPR unsigned long
1242 signaling_NaN() throw() { return static_cast<unsigned long>(0); }
1243
1244 static _GLIBCXX_CONSTEXPR unsigned long
1245 denorm_min() throw() { return static_cast<unsigned long>(0); }
1246
1247 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
1248 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
1249 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true;
1250
1251 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps;
1252 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;
1253 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
1254 = round_toward_zero;
1255 };
1256
1257 /// numeric_limits<long long> specialization.
1258 template<>
1259 struct numeric_limits<long long>
1260 {
1261 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
1262
1263 static _GLIBCXX_CONSTEXPR long long
1264 min() throw() { return -__LONG_LONG_MAX__ - 1; }
1265
1266 static _GLIBCXX_CONSTEXPR long long
1267 max() throw() { return __LONG_LONG_MAX__; }
1268
1269 #ifdef __GXX_EXPERIMENTAL_CXX0X__
1270 static constexpr long long
1271 lowest() throw() { return min(); }
1272 #endif
1273
1274 static _GLIBCXX_USE_CONSTEXPR int digits
1275 = __glibcxx_digits (long long);
1276 static _GLIBCXX_USE_CONSTEXPR int digits10
1277 = __glibcxx_digits10 (long long);
1278 #ifdef __GXX_EXPERIMENTAL_CXX0X__
1279 static constexpr int max_digits10 = 0;
1280 #endif
1281 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true;
1282 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true;
1283 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true;
1284 static _GLIBCXX_USE_CONSTEXPR int radix = 2;
1285
1286 static _GLIBCXX_CONSTEXPR long long
1287 epsilon() throw() { return 0; }
1288
1289 static _GLIBCXX_CONSTEXPR long long
1290 round_error() throw() { return 0; }
1291
1292 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
1293 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0;
1294 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0;
1295 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0;
1296
1297 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false;
1298 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false;
1299 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false;
1300 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
1301 = denorm_absent;
1302 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
1303
1304 static _GLIBCXX_CONSTEXPR long long
1305 infinity() throw() { return static_cast<long long>(0); }
1306
1307 static _GLIBCXX_CONSTEXPR long long
1308 quiet_NaN() throw() { return static_cast<long long>(0); }
1309
1310 static _GLIBCXX_CONSTEXPR long long
1311 signaling_NaN() throw() { return static_cast<long long>(0); }
1312
1313 static _GLIBCXX_CONSTEXPR long long
1314 denorm_min() throw() { return static_cast<long long>(0); }
1315
1316 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
1317 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
1318 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true;
1319
1320 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps;
1321 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;
1322 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
1323 = round_toward_zero;
1324 };
1325
1326 /// numeric_limits<unsigned long long> specialization.
1327 template<>
1328 struct numeric_limits<unsigned long long>
1329 {
1330 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
1331
1332 static _GLIBCXX_CONSTEXPR unsigned long long
1333 min() throw() { return 0; }
1334
1335 static _GLIBCXX_CONSTEXPR unsigned long long
1336 max() throw() { return __LONG_LONG_MAX__ * 2ULL + 1; }
1337
1338 #ifdef __GXX_EXPERIMENTAL_CXX0X__
1339 static constexpr unsigned long long
1340 lowest() throw() { return min(); }
1341 #endif
1342
1343 static _GLIBCXX_USE_CONSTEXPR int digits
1344 = __glibcxx_digits (unsigned long long);
1345 static _GLIBCXX_USE_CONSTEXPR int digits10
1346 = __glibcxx_digits10 (unsigned long long);
1347 #ifdef __GXX_EXPERIMENTAL_CXX0X__
1348 static constexpr int max_digits10 = 0;
1349 #endif
1350 static _GLIBCXX_USE_CONSTEXPR bool is_signed = false;
1351 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true;
1352 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true;
1353 static _GLIBCXX_USE_CONSTEXPR int radix = 2;
1354
1355 static _GLIBCXX_CONSTEXPR unsigned long long
1356 epsilon() throw() { return 0; }
1357
1358 static _GLIBCXX_CONSTEXPR unsigned long long
1359 round_error() throw() { return 0; }
1360
1361 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
1362 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0;
1363 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0;
1364 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0;
1365
1366 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false;
1367 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false;
1368 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false;
1369 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
1370 = denorm_absent;
1371 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
1372
1373 static _GLIBCXX_CONSTEXPR unsigned long long
1374 infinity() throw() { return static_cast<unsigned long long>(0); }
1375
1376 static _GLIBCXX_CONSTEXPR unsigned long long
1377 quiet_NaN() throw() { return static_cast<unsigned long long>(0); }
1378
1379 static _GLIBCXX_CONSTEXPR unsigned long long
1380 signaling_NaN() throw() { return static_cast<unsigned long long>(0); }
1381
1382 static _GLIBCXX_CONSTEXPR unsigned long long
1383 denorm_min() throw() { return static_cast<unsigned long long>(0); }
1384
1385 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
1386 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
1387 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true;
1388
1389 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps;
1390 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;
1391 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
1392 = round_toward_zero;
1393 };
1394
1395 /// numeric_limits<float> specialization.
1396 template<>
1397 struct numeric_limits<float>
1398 {
1399 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
1400
1401 static _GLIBCXX_CONSTEXPR float
1402 min() throw() { return __FLT_MIN__; }
1403
1404 static _GLIBCXX_CONSTEXPR float
1405 max() throw() { return __FLT_MAX__; }
1406
1407 #ifdef __GXX_EXPERIMENTAL_CXX0X__
1408 static constexpr float
1409 lowest() throw() { return -__FLT_MAX__; }
1410 #endif
1411
1412 static _GLIBCXX_USE_CONSTEXPR int digits = __FLT_MANT_DIG__;
1413 static _GLIBCXX_USE_CONSTEXPR int digits10 = __FLT_DIG__;
1414 #ifdef __GXX_EXPERIMENTAL_CXX0X__
1415 static constexpr int max_digits10
1416 = __glibcxx_max_digits10 (__FLT_MANT_DIG__);
1417 #endif
1418 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true;
1419 static _GLIBCXX_USE_CONSTEXPR bool is_integer = false;
1420 static _GLIBCXX_USE_CONSTEXPR bool is_exact = false;
1421 static _GLIBCXX_USE_CONSTEXPR int radix = __FLT_RADIX__;
1422
1423 static _GLIBCXX_CONSTEXPR float
1424 epsilon() throw() { return __FLT_EPSILON__; }
1425
1426 static _GLIBCXX_CONSTEXPR float
1427 round_error() throw() { return 0.5F; }
1428
1429 static _GLIBCXX_USE_CONSTEXPR int min_exponent = __FLT_MIN_EXP__;
1430 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = __FLT_MIN_10_EXP__;
1431 static _GLIBCXX_USE_CONSTEXPR int max_exponent = __FLT_MAX_EXP__;
1432 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = __FLT_MAX_10_EXP__;
1433
1434 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = __FLT_HAS_INFINITY__;
1435 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = __FLT_HAS_QUIET_NAN__;
1436 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = has_quiet_NaN;
1437 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
1438 = bool(__FLT_HAS_DENORM__) ? denorm_present : denorm_absent;
1439 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss
1440 = __glibcxx_float_has_denorm_loss;
1441
1442 static _GLIBCXX_CONSTEXPR float
1443 infinity() throw() { return __builtin_huge_valf (); }
1444
1445 static _GLIBCXX_CONSTEXPR float
1446 quiet_NaN() throw() { return __builtin_nanf (""); }
1447
1448 static _GLIBCXX_CONSTEXPR float
1449 signaling_NaN() throw() { return __builtin_nansf (""); }
1450
1451 static _GLIBCXX_CONSTEXPR float
1452 denorm_min() throw() { return __FLT_DENORM_MIN__; }
1453
1454 static _GLIBCXX_USE_CONSTEXPR bool is_iec559
1455 = has_infinity && has_quiet_NaN && has_denorm == denorm_present;
1456 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
1457 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false;
1458
1459 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_float_traps;
1460 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before
1461 = __glibcxx_float_tinyness_before;
1462 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
1463 = round_to_nearest;
1464 };
1465
1466 #undef __glibcxx_float_has_denorm_loss
1467 #undef __glibcxx_float_traps
1468 #undef __glibcxx_float_tinyness_before
1469
1470 /// numeric_limits<double> specialization.
1471 template<>
1472 struct numeric_limits<double>
1473 {
1474 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
1475
1476 static _GLIBCXX_CONSTEXPR double
1477 min() throw() { return __DBL_MIN__; }
1478
1479 static _GLIBCXX_CONSTEXPR double
1480 max() throw() { return __DBL_MAX__; }
1481
1482 #ifdef __GXX_EXPERIMENTAL_CXX0X__
1483 static constexpr double
1484 lowest() throw() { return -__DBL_MAX__; }
1485 #endif
1486
1487 static _GLIBCXX_USE_CONSTEXPR int digits = __DBL_MANT_DIG__;
1488 static _GLIBCXX_USE_CONSTEXPR int digits10 = __DBL_DIG__;
1489 #ifdef __GXX_EXPERIMENTAL_CXX0X__
1490 static constexpr int max_digits10
1491 = __glibcxx_max_digits10 (__DBL_MANT_DIG__);
1492 #endif
1493 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true;
1494 static _GLIBCXX_USE_CONSTEXPR bool is_integer = false;
1495 static _GLIBCXX_USE_CONSTEXPR bool is_exact = false;
1496 static _GLIBCXX_USE_CONSTEXPR int radix = __FLT_RADIX__;
1497
1498 static _GLIBCXX_CONSTEXPR double
1499 epsilon() throw() { return __DBL_EPSILON__; }
1500
1501 static _GLIBCXX_CONSTEXPR double
1502 round_error() throw() { return 0.5; }
1503
1504 static _GLIBCXX_USE_CONSTEXPR int min_exponent = __DBL_MIN_EXP__;
1505 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = __DBL_MIN_10_EXP__;
1506 static _GLIBCXX_USE_CONSTEXPR int max_exponent = __DBL_MAX_EXP__;
1507 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = __DBL_MAX_10_EXP__;
1508
1509 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = __DBL_HAS_INFINITY__;
1510 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = __DBL_HAS_QUIET_NAN__;
1511 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = has_quiet_NaN;
1512 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
1513 = bool(__DBL_HAS_DENORM__) ? denorm_present : denorm_absent;
1514 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss
1515 = __glibcxx_double_has_denorm_loss;
1516
1517 static _GLIBCXX_CONSTEXPR double
1518 infinity() throw() { return __builtin_huge_val(); }
1519
1520 static _GLIBCXX_CONSTEXPR double
1521 quiet_NaN() throw() { return __builtin_nan (""); }
1522
1523 static _GLIBCXX_CONSTEXPR double
1524 signaling_NaN() throw() { return __builtin_nans (""); }
1525
1526 static _GLIBCXX_CONSTEXPR double
1527 denorm_min() throw() { return __DBL_DENORM_MIN__; }
1528
1529 static _GLIBCXX_USE_CONSTEXPR bool is_iec559
1530 = has_infinity && has_quiet_NaN && has_denorm == denorm_present;
1531 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
1532 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false;
1533
1534 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_double_traps;
1535 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before
1536 = __glibcxx_double_tinyness_before;
1537 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
1538 = round_to_nearest;
1539 };
1540
1541 #undef __glibcxx_double_has_denorm_loss
1542 #undef __glibcxx_double_traps
1543 #undef __glibcxx_double_tinyness_before
1544
1545 /// numeric_limits<long double> specialization.
1546 template<>
1547 struct numeric_limits<long double>
1548 {
1549 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
1550
1551 static _GLIBCXX_CONSTEXPR long double
1552 min() throw() { return __LDBL_MIN__; }
1553
1554 static _GLIBCXX_CONSTEXPR long double
1555 max() throw() { return __LDBL_MAX__; }
1556
1557 #ifdef __GXX_EXPERIMENTAL_CXX0X__
1558 static constexpr long double
1559 lowest() throw() { return -__LDBL_MAX__; }
1560 #endif
1561
1562 static _GLIBCXX_USE_CONSTEXPR int digits = __LDBL_MANT_DIG__;
1563 static _GLIBCXX_USE_CONSTEXPR int digits10 = __LDBL_DIG__;
1564 #ifdef __GXX_EXPERIMENTAL_CXX0X__
1565 static _GLIBCXX_USE_CONSTEXPR int max_digits10
1566 = __glibcxx_max_digits10 (__LDBL_MANT_DIG__);
1567 #endif
1568 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true;
1569 static _GLIBCXX_USE_CONSTEXPR bool is_integer = false;
1570 static _GLIBCXX_USE_CONSTEXPR bool is_exact = false;
1571 static _GLIBCXX_USE_CONSTEXPR int radix = __FLT_RADIX__;
1572
1573 static _GLIBCXX_CONSTEXPR long double
1574 epsilon() throw() { return __LDBL_EPSILON__; }
1575
1576 static _GLIBCXX_CONSTEXPR long double
1577 round_error() throw() { return 0.5L; }
1578
1579 static _GLIBCXX_USE_CONSTEXPR int min_exponent = __LDBL_MIN_EXP__;
1580 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = __LDBL_MIN_10_EXP__;
1581 static _GLIBCXX_USE_CONSTEXPR int max_exponent = __LDBL_MAX_EXP__;
1582 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = __LDBL_MAX_10_EXP__;
1583
1584 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = __LDBL_HAS_INFINITY__;
1585 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = __LDBL_HAS_QUIET_NAN__;
1586 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = has_quiet_NaN;
1587 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
1588 = bool(__LDBL_HAS_DENORM__) ? denorm_present : denorm_absent;
1589 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss
1590 = __glibcxx_long_double_has_denorm_loss;
1591
1592 static _GLIBCXX_CONSTEXPR long double
1593 infinity() throw() { return __builtin_huge_vall (); }
1594
1595 static _GLIBCXX_CONSTEXPR long double
1596 quiet_NaN() throw() { return __builtin_nanl (""); }
1597
1598 static _GLIBCXX_CONSTEXPR long double
1599 signaling_NaN() throw() { return __builtin_nansl (""); }
1600
1601 static _GLIBCXX_CONSTEXPR long double
1602 denorm_min() throw() { return __LDBL_DENORM_MIN__; }
1603
1604 static _GLIBCXX_USE_CONSTEXPR bool is_iec559
1605 = has_infinity && has_quiet_NaN && has_denorm == denorm_present;
1606 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
1607 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false;
1608
1609 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_long_double_traps;
1610 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before =
1611 __glibcxx_long_double_tinyness_before;
1612 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style =
1613 round_to_nearest;
1614 };
1615
1616 #undef __glibcxx_long_double_has_denorm_loss
1617 #undef __glibcxx_long_double_traps
1618 #undef __glibcxx_long_double_tinyness_before
1619
1620 _GLIBCXX_END_NAMESPACE
1621
1622 #undef __glibcxx_signed
1623 #undef __glibcxx_min
1624 #undef __glibcxx_max
1625 #undef __glibcxx_digits
1626 #undef __glibcxx_digits10
1627 #undef __glibcxx_max_digits10
1628
1629 #endif // _GLIBCXX_NUMERIC_LIMITS