1 // The template and inlines for the numeric_limits classes. -*- C++ -*-
3 // Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
4 // 2008, 2009, 2010 Free Software Foundation, Inc.
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)
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.
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.
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/>.
26 /** @file include/limits
27 * This is a Standard C++ Library header.
30 // Note: this is not a conforming implementation.
31 // Written by Gabriel Dos Reis <gdr@codesourcery.com>
38 #ifndef _GLIBCXX_NUMERIC_LIMITS
39 #define _GLIBCXX_NUMERIC_LIMITS 1
41 #pragma GCC system_header
43 #include <bits/c++config.h>
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:
51 // char, signed char, unsigned char, wchar_t (4)
52 // short, unsigned short (2)
54 // long, unsigned long (2)
61 // GNU C++ understands (where supported by the host C-library)
63 // long long, unsigned long long (2)
65 // which brings us to 16 fundamental arithmetic data types in GNU C++.
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.
74 // These values can be overridden in the target configuration file.
75 // The default values are appropriate for many 32-bit targets.
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
87 // Default values. Should be overridden in configuration files if necessary.
89 #ifndef __glibcxx_float_has_denorm_loss
90 # define __glibcxx_float_has_denorm_loss false
92 #ifndef __glibcxx_float_traps
93 # define __glibcxx_float_traps false
95 #ifndef __glibcxx_float_tinyness_before
96 # define __glibcxx_float_tinyness_before false
101 // Default values. Should be overridden in configuration files if necessary.
103 #ifndef __glibcxx_double_has_denorm_loss
104 # define __glibcxx_double_has_denorm_loss false
106 #ifndef __glibcxx_double_traps
107 # define __glibcxx_double_traps false
109 #ifndef __glibcxx_double_tinyness_before
110 # define __glibcxx_double_tinyness_before false
115 // Default values. Should be overridden in configuration files if necessary.
117 #ifndef __glibcxx_long_double_has_denorm_loss
118 # define __glibcxx_long_double_has_denorm_loss false
120 #ifndef __glibcxx_long_double_traps
121 # define __glibcxx_long_double_traps false
123 #ifndef __glibcxx_long_double_tinyness_before
124 # define __glibcxx_long_double_tinyness_before false
127 // You should not need to define any macros below this point.
129 #define __glibcxx_signed(T) ((T)(-1) < 0)
131 #define __glibcxx_min(T) \
132 (__glibcxx_signed (T) ? (T)1 << __glibcxx_digits (T) : (T)0)
134 #define __glibcxx_max(T) \
135 (__glibcxx_signed (T) ? \
136 (((((T)1 << (__glibcxx_digits (T) - 1)) - 1) << 1) + 1) : ~(T)0)
138 #define __glibcxx_digits(T) \
139 (sizeof(T) * __CHAR_BIT__ - __glibcxx_signed (T))
141 // The fraction 643/2136 approximates log10(2) to 7 significant digits.
142 #define __glibcxx_digits10(T) \
143 (__glibcxx_digits (T) * 643L / 2136)
145 #define __glibcxx_max_digits10(T) \
146 (2 + (T) * 643L / 2136)
148 _GLIBCXX_BEGIN_NAMESPACE(std)
151 * @brief Describes the rounding style for floating-point types.
153 * This is used in the std::numeric_limits class.
155 enum float_round_style
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.
165 * @brief Describes the denormalization for floating-point types.
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.
170 enum float_denorm_style
172 /// Indeterminate at compile time whether denormalized values are allowed.
173 denorm_indeterminate = -1,
174 /// The type does not allow denormalized values.
176 /// The type allows denormalized values.
181 * @brief Part of std::numeric_limits.
183 * The @c static @c const members are usable as integral constant
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.
190 struct __numeric_limits_base
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;
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;
201 /** The number of base 10 digits that can be represented without change. */
202 static _GLIBCXX_USE_CONSTEXPR int digits10 = 0;
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;
210 /** True if the type is signed. */
211 static _GLIBCXX_USE_CONSTEXPR bool is_signed = false;
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;
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>
221 static _GLIBCXX_USE_CONSTEXPR bool is_exact = false;
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;
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;
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;
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
238 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0;
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;
244 /** True if the type has a representation for positive infinity. */
245 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false;
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;
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;
255 /** See std::float_denorm_style for more information. */
256 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm = denorm_absent;
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;
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;
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;
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;
277 /** True if trapping is implemented for this type. */
278 static _GLIBCXX_USE_CONSTEXPR bool traps = false;
280 /** True if tininess is detected before rounding. (see IEC 559) */
281 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;
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 =
291 * @brief Properties of fundamental types.
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.
298 * _GLIBCXX_RESOLVE_LIB_DEFECTS: DRs 201 and 184 (hi Gaby!) are
299 * noted, but not incorporated in this documented (yet).
301 template<typename _Tp>
302 struct numeric_limits : public __numeric_limits_base
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); }
309 /** The maximum finite value. */
310 static _GLIBCXX_CONSTEXPR _Tp
311 max() throw() { return static_cast<_Tp>(0); }
313 #ifdef __GXX_EXPERIMENTAL_CXX0X__
314 /** A finite value x such that there is no other finite value y
317 lowest() throw() { return static_cast<_Tp>(0); }
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); }
325 /** The maximum rounding error measurement (see LIA-1). */
326 static _GLIBCXX_CONSTEXPR _Tp
327 round_error() throw() { return static_cast<_Tp>(0); }
329 /** The representation of positive infinity, if @c has_infinity. */
330 static _GLIBCXX_CONSTEXPR _Tp
331 infinity() throw() { return static_cast<_Tp>(0); }
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); }
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); }
343 /** The minimum positive denormalized value. For types where
344 @c has_denorm is false, this is the minimum positive normalized
346 static _GLIBCXX_CONSTEXPR _Tp
347 denorm_min() throw() { return static_cast<_Tp>(0); }
350 #ifdef __GXX_EXPERIMENTAL_CXX0X__
351 template<typename _Tp>
352 struct numeric_limits<const _Tp>
353 : public numeric_limits<_Tp> { };
355 template<typename _Tp>
356 struct numeric_limits<volatile _Tp>
357 : public numeric_limits<_Tp> { };
359 template<typename _Tp>
360 struct numeric_limits<const volatile _Tp>
361 : public numeric_limits<_Tp> { };
364 // Now there follow 16 explicit specializations. Yes, 16. Make sure
365 // you get the count right. (18 in c++0x mode)
367 /// numeric_limits<bool> specialization.
369 struct numeric_limits<bool>
371 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
373 static _GLIBCXX_CONSTEXPR bool
374 min() throw() { return false; }
376 static _GLIBCXX_CONSTEXPR bool
377 max() throw() { return true; }
379 #ifdef __GXX_EXPERIMENTAL_CXX0X__
380 static constexpr bool
381 lowest() throw() { return min(); }
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;
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;
393 static _GLIBCXX_CONSTEXPR bool
394 epsilon() throw() { return false; }
396 static _GLIBCXX_CONSTEXPR bool
397 round_error() throw() { return false; }
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;
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
409 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
411 static _GLIBCXX_CONSTEXPR bool
412 infinity() throw() { return false; }
414 static _GLIBCXX_CONSTEXPR bool
415 quiet_NaN() throw() { return false; }
417 static _GLIBCXX_CONSTEXPR bool
418 signaling_NaN() throw() { return false; }
420 static _GLIBCXX_CONSTEXPR bool
421 denorm_min() throw() { return false; }
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;
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
436 /// numeric_limits<char> specialization.
438 struct numeric_limits<char>
440 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
442 static _GLIBCXX_CONSTEXPR char
443 min() throw() { return __glibcxx_min(char); }
445 static _GLIBCXX_CONSTEXPR char
446 max() throw() { return __glibcxx_max(char); }
448 #ifdef __GXX_EXPERIMENTAL_CXX0X__
449 static constexpr char
450 lowest() throw() { return min(); }
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;
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;
463 static _GLIBCXX_CONSTEXPR char
464 epsilon() throw() { return 0; }
466 static _GLIBCXX_CONSTEXPR char
467 round_error() throw() { return 0; }
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;
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
479 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
481 static _GLIBCXX_CONSTEXPR
482 char infinity() throw() { return char(); }
484 static _GLIBCXX_CONSTEXPR char
485 quiet_NaN() throw() { return char(); }
487 static _GLIBCXX_CONSTEXPR char
488 signaling_NaN() throw() { return char(); }
490 static _GLIBCXX_CONSTEXPR char
491 denorm_min() throw() { return static_cast<char>(0); }
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;
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
503 /// numeric_limits<signed char> specialization.
505 struct numeric_limits<signed char>
507 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
509 static _GLIBCXX_CONSTEXPR signed char
510 min() throw() { return -__SCHAR_MAX__ - 1; }
512 static _GLIBCXX_CONSTEXPR signed char
513 max() throw() { return __SCHAR_MAX__; }
515 #ifdef __GXX_EXPERIMENTAL_CXX0X__
516 static constexpr signed char
517 lowest() throw() { return min(); }
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;
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;
531 static _GLIBCXX_CONSTEXPR signed char
532 epsilon() throw() { return 0; }
534 static _GLIBCXX_CONSTEXPR signed char
535 round_error() throw() { return 0; }
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;
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
547 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
549 static _GLIBCXX_CONSTEXPR signed char
550 infinity() throw() { return static_cast<signed char>(0); }
552 static _GLIBCXX_CONSTEXPR signed char
553 quiet_NaN() throw() { return static_cast<signed char>(0); }
555 static _GLIBCXX_CONSTEXPR signed char
556 signaling_NaN() throw() { return static_cast<signed char>(0); }
558 static _GLIBCXX_CONSTEXPR signed char
559 denorm_min() throw() { return static_cast<signed char>(0); }
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;
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
571 /// numeric_limits<unsigned char> specialization.
573 struct numeric_limits<unsigned char>
575 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
577 static _GLIBCXX_CONSTEXPR unsigned char
578 min() throw() { return 0; }
580 static _GLIBCXX_CONSTEXPR unsigned char
581 max() throw() { return __SCHAR_MAX__ * 2U + 1; }
583 #ifdef __GXX_EXPERIMENTAL_CXX0X__
584 static constexpr unsigned char
585 lowest() throw() { return min(); }
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;
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;
600 static _GLIBCXX_CONSTEXPR unsigned char
601 epsilon() throw() { return 0; }
603 static _GLIBCXX_CONSTEXPR unsigned char
604 round_error() throw() { return 0; }
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;
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
616 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
618 static _GLIBCXX_CONSTEXPR unsigned char
619 infinity() throw() { return static_cast<unsigned char>(0); }
621 static _GLIBCXX_CONSTEXPR unsigned char
622 quiet_NaN() throw() { return static_cast<unsigned char>(0); }
624 static _GLIBCXX_CONSTEXPR unsigned char
625 signaling_NaN() throw() { return static_cast<unsigned char>(0); }
627 static _GLIBCXX_CONSTEXPR unsigned char
628 denorm_min() throw() { return static_cast<unsigned char>(0); }
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;
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
640 /// numeric_limits<wchar_t> specialization.
642 struct numeric_limits<wchar_t>
644 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
646 static _GLIBCXX_CONSTEXPR wchar_t
647 min() throw() { return __glibcxx_min (wchar_t); }
649 static _GLIBCXX_CONSTEXPR wchar_t
650 max() throw() { return __glibcxx_max (wchar_t); }
652 #ifdef __GXX_EXPERIMENTAL_CXX0X__
653 static constexpr wchar_t
654 lowest() throw() { return min(); }
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;
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;
668 static _GLIBCXX_CONSTEXPR wchar_t
669 epsilon() throw() { return 0; }
671 static _GLIBCXX_CONSTEXPR wchar_t
672 round_error() throw() { return 0; }
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;
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
684 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
686 static _GLIBCXX_CONSTEXPR wchar_t
687 infinity() throw() { return wchar_t(); }
689 static _GLIBCXX_CONSTEXPR wchar_t
690 quiet_NaN() throw() { return wchar_t(); }
692 static _GLIBCXX_CONSTEXPR wchar_t
693 signaling_NaN() throw() { return wchar_t(); }
695 static _GLIBCXX_CONSTEXPR wchar_t
696 denorm_min() throw() { return wchar_t(); }
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;
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
708 #ifdef __GXX_EXPERIMENTAL_CXX0X__
709 /// numeric_limits<char16_t> specialization.
711 struct numeric_limits<char16_t>
713 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
715 static _GLIBCXX_CONSTEXPR char16_t
716 min() throw() { return __glibcxx_min (char16_t); }
718 static _GLIBCXX_CONSTEXPR char16_t
719 max() throw() { return __glibcxx_max (char16_t); }
721 #ifdef __GXX_EXPERIMENTAL_CXX0X__
722 static constexpr char16_t
723 lowest() throw() { return min(); }
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;
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;
739 static _GLIBCXX_CONSTEXPR char16_t
740 epsilon() throw() { return 0; }
742 static _GLIBCXX_CONSTEXPR char16_t
743 round_error() throw() { return 0; }
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;
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
755 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
757 static _GLIBCXX_CONSTEXPR char16_t
758 infinity() throw() { return char16_t(); }
760 static _GLIBCXX_CONSTEXPR char16_t
761 quiet_NaN() throw() { return char16_t(); }
763 static _GLIBCXX_CONSTEXPR char16_t
764 signaling_NaN() throw() { return char16_t(); }
766 static _GLIBCXX_CONSTEXPR char16_t
767 denorm_min() throw() { return char16_t(); }
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;
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
779 /// numeric_limits<char32_t> specialization.
781 struct numeric_limits<char32_t>
783 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
785 static _GLIBCXX_CONSTEXPR char32_t
786 min() throw() { return __glibcxx_min (char32_t); }
788 static _GLIBCXX_CONSTEXPR char32_t
789 max() throw() { return __glibcxx_max (char32_t); }
791 #ifdef __GXX_EXPERIMENTAL_CXX0X__
792 static constexpr char32_t
793 lowest() throw() { return min(); }
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;
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;
808 static _GLIBCXX_CONSTEXPR char32_t
809 epsilon() throw() { return 0; }
811 static _GLIBCXX_CONSTEXPR char32_t
812 round_error() throw() { return 0; }
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;
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
824 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
826 static _GLIBCXX_CONSTEXPR char32_t
827 infinity() throw() { return char32_t(); }
829 static _GLIBCXX_CONSTEXPR char32_t
830 quiet_NaN() throw() { return char32_t(); }
832 static _GLIBCXX_CONSTEXPR char32_t
833 signaling_NaN() throw() { return char32_t(); }
835 static _GLIBCXX_CONSTEXPR char32_t
836 denorm_min() throw() { return char32_t(); }
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;
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
849 /// numeric_limits<short> specialization.
851 struct numeric_limits<short>
853 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
855 static _GLIBCXX_CONSTEXPR short
856 min() throw() { return -__SHRT_MAX__ - 1; }
858 static _GLIBCXX_CONSTEXPR short
859 max() throw() { return __SHRT_MAX__; }
861 #ifdef __GXX_EXPERIMENTAL_CXX0X__
862 static constexpr short
863 lowest() throw() { return min(); }
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;
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;
876 static _GLIBCXX_CONSTEXPR short
877 epsilon() throw() { return 0; }
879 static _GLIBCXX_CONSTEXPR short
880 round_error() throw() { return 0; }
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;
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
892 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
894 static _GLIBCXX_CONSTEXPR short
895 infinity() throw() { return short(); }
897 static _GLIBCXX_CONSTEXPR short
898 quiet_NaN() throw() { return short(); }
900 static _GLIBCXX_CONSTEXPR short
901 signaling_NaN() throw() { return short(); }
903 static _GLIBCXX_CONSTEXPR short
904 denorm_min() throw() { return short(); }
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;
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
916 /// numeric_limits<unsigned short> specialization.
918 struct numeric_limits<unsigned short>
920 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
922 static _GLIBCXX_CONSTEXPR unsigned short
923 min() throw() { return 0; }
925 static _GLIBCXX_CONSTEXPR unsigned short
926 max() throw() { return __SHRT_MAX__ * 2U + 1; }
928 #ifdef __GXX_EXPERIMENTAL_CXX0X__
929 static constexpr unsigned short
930 lowest() throw() { return min(); }
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;
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;
945 static _GLIBCXX_CONSTEXPR unsigned short
946 epsilon() throw() { return 0; }
948 static _GLIBCXX_CONSTEXPR unsigned short
949 round_error() throw() { return 0; }
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;
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
961 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
963 static _GLIBCXX_CONSTEXPR unsigned short
964 infinity() throw() { return static_cast<unsigned short>(0); }
966 static _GLIBCXX_CONSTEXPR unsigned short
967 quiet_NaN() throw() { return static_cast<unsigned short>(0); }
969 static _GLIBCXX_CONSTEXPR unsigned short
970 signaling_NaN() throw() { return static_cast<unsigned short>(0); }
972 static _GLIBCXX_CONSTEXPR unsigned short
973 denorm_min() throw() { return static_cast<unsigned short>(0); }
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;
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
985 /// numeric_limits<int> specialization.
987 struct numeric_limits<int>
989 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
991 static _GLIBCXX_CONSTEXPR int
992 min() throw() { return -__INT_MAX__ - 1; }
994 static _GLIBCXX_CONSTEXPR int
995 max() throw() { return __INT_MAX__; }
997 #ifdef __GXX_EXPERIMENTAL_CXX0X__
999 lowest() throw() { return min(); }
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;
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;
1012 static _GLIBCXX_CONSTEXPR int
1013 epsilon() throw() { return 0; }
1015 static _GLIBCXX_CONSTEXPR int
1016 round_error() throw() { return 0; }
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;
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
1028 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
1030 static _GLIBCXX_CONSTEXPR int
1031 infinity() throw() { return static_cast<int>(0); }
1033 static _GLIBCXX_CONSTEXPR int
1034 quiet_NaN() throw() { return static_cast<int>(0); }
1036 static _GLIBCXX_CONSTEXPR int
1037 signaling_NaN() throw() { return static_cast<int>(0); }
1039 static _GLIBCXX_CONSTEXPR int
1040 denorm_min() throw() { return static_cast<int>(0); }
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;
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;
1052 /// numeric_limits<unsigned int> specialization.
1054 struct numeric_limits<unsigned int>
1056 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
1058 static _GLIBCXX_CONSTEXPR unsigned int
1059 min() throw() { return 0; }
1061 static _GLIBCXX_CONSTEXPR unsigned int
1062 max() throw() { return __INT_MAX__ * 2U + 1; }
1064 #ifdef __GXX_EXPERIMENTAL_CXX0X__
1065 static constexpr unsigned int
1066 lowest() throw() { return min(); }
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;
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;
1081 static _GLIBCXX_CONSTEXPR unsigned int
1082 epsilon() throw() { return 0; }
1084 static _GLIBCXX_CONSTEXPR unsigned int
1085 round_error() throw() { return 0; }
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;
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
1097 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
1099 static _GLIBCXX_CONSTEXPR unsigned int
1100 infinity() throw() { return static_cast<unsigned int>(0); }
1102 static _GLIBCXX_CONSTEXPR unsigned int
1103 quiet_NaN() throw() { return static_cast<unsigned int>(0); }
1105 static _GLIBCXX_CONSTEXPR unsigned int
1106 signaling_NaN() throw() { return static_cast<unsigned int>(0); }
1108 static _GLIBCXX_CONSTEXPR unsigned int
1109 denorm_min() throw() { return static_cast<unsigned int>(0); }
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;
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;
1121 /// numeric_limits<long> specialization.
1123 struct numeric_limits<long>
1125 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
1127 static _GLIBCXX_CONSTEXPR long
1128 min() throw() { return -__LONG_MAX__ - 1; }
1130 static _GLIBCXX_CONSTEXPR long
1131 max() throw() { return __LONG_MAX__; }
1133 #ifdef __GXX_EXPERIMENTAL_CXX0X__
1134 static constexpr long
1135 lowest() throw() { return min(); }
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;
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;
1148 static _GLIBCXX_CONSTEXPR long
1149 epsilon() throw() { return 0; }
1151 static _GLIBCXX_CONSTEXPR long
1152 round_error() throw() { return 0; }
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;
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
1164 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
1166 static _GLIBCXX_CONSTEXPR long
1167 infinity() throw() { return static_cast<long>(0); }
1169 static _GLIBCXX_CONSTEXPR long
1170 quiet_NaN() throw() { return static_cast<long>(0); }
1172 static _GLIBCXX_CONSTEXPR long
1173 signaling_NaN() throw() { return static_cast<long>(0); }
1175 static _GLIBCXX_CONSTEXPR long
1176 denorm_min() throw() { return static_cast<long>(0); }
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;
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;
1188 /// numeric_limits<unsigned long> specialization.
1190 struct numeric_limits<unsigned long>
1192 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
1194 static _GLIBCXX_CONSTEXPR unsigned long
1195 min() throw() { return 0; }
1197 static _GLIBCXX_CONSTEXPR unsigned long
1198 max() throw() { return __LONG_MAX__ * 2UL + 1; }
1200 #ifdef __GXX_EXPERIMENTAL_CXX0X__
1201 static constexpr unsigned long
1202 lowest() throw() { return min(); }
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;
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;
1217 static _GLIBCXX_CONSTEXPR unsigned long
1218 epsilon() throw() { return 0; }
1220 static _GLIBCXX_CONSTEXPR unsigned long
1221 round_error() throw() { return 0; }
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;
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
1233 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
1235 static _GLIBCXX_CONSTEXPR unsigned long
1236 infinity() throw() { return static_cast<unsigned long>(0); }
1238 static _GLIBCXX_CONSTEXPR unsigned long
1239 quiet_NaN() throw() { return static_cast<unsigned long>(0); }
1241 static _GLIBCXX_CONSTEXPR unsigned long
1242 signaling_NaN() throw() { return static_cast<unsigned long>(0); }
1244 static _GLIBCXX_CONSTEXPR unsigned long
1245 denorm_min() throw() { return static_cast<unsigned long>(0); }
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;
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;
1257 /// numeric_limits<long long> specialization.
1259 struct numeric_limits<long long>
1261 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
1263 static _GLIBCXX_CONSTEXPR long long
1264 min() throw() { return -__LONG_LONG_MAX__ - 1; }
1266 static _GLIBCXX_CONSTEXPR long long
1267 max() throw() { return __LONG_LONG_MAX__; }
1269 #ifdef __GXX_EXPERIMENTAL_CXX0X__
1270 static constexpr long long
1271 lowest() throw() { return min(); }
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;
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;
1286 static _GLIBCXX_CONSTEXPR long long
1287 epsilon() throw() { return 0; }
1289 static _GLIBCXX_CONSTEXPR long long
1290 round_error() throw() { return 0; }
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;
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
1302 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
1304 static _GLIBCXX_CONSTEXPR long long
1305 infinity() throw() { return static_cast<long long>(0); }
1307 static _GLIBCXX_CONSTEXPR long long
1308 quiet_NaN() throw() { return static_cast<long long>(0); }
1310 static _GLIBCXX_CONSTEXPR long long
1311 signaling_NaN() throw() { return static_cast<long long>(0); }
1313 static _GLIBCXX_CONSTEXPR long long
1314 denorm_min() throw() { return static_cast<long long>(0); }
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;
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;
1326 /// numeric_limits<unsigned long long> specialization.
1328 struct numeric_limits<unsigned long long>
1330 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
1332 static _GLIBCXX_CONSTEXPR unsigned long long
1333 min() throw() { return 0; }
1335 static _GLIBCXX_CONSTEXPR unsigned long long
1336 max() throw() { return __LONG_LONG_MAX__ * 2ULL + 1; }
1338 #ifdef __GXX_EXPERIMENTAL_CXX0X__
1339 static constexpr unsigned long long
1340 lowest() throw() { return min(); }
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;
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;
1355 static _GLIBCXX_CONSTEXPR unsigned long long
1356 epsilon() throw() { return 0; }
1358 static _GLIBCXX_CONSTEXPR unsigned long long
1359 round_error() throw() { return 0; }
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;
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
1371 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
1373 static _GLIBCXX_CONSTEXPR unsigned long long
1374 infinity() throw() { return static_cast<unsigned long long>(0); }
1376 static _GLIBCXX_CONSTEXPR unsigned long long
1377 quiet_NaN() throw() { return static_cast<unsigned long long>(0); }
1379 static _GLIBCXX_CONSTEXPR unsigned long long
1380 signaling_NaN() throw() { return static_cast<unsigned long long>(0); }
1382 static _GLIBCXX_CONSTEXPR unsigned long long
1383 denorm_min() throw() { return static_cast<unsigned long long>(0); }
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;
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;
1395 /// numeric_limits<float> specialization.
1397 struct numeric_limits<float>
1399 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
1401 static _GLIBCXX_CONSTEXPR float
1402 min() throw() { return __FLT_MIN__; }
1404 static _GLIBCXX_CONSTEXPR float
1405 max() throw() { return __FLT_MAX__; }
1407 #ifdef __GXX_EXPERIMENTAL_CXX0X__
1408 static constexpr float
1409 lowest() throw() { return -__FLT_MAX__; }
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__);
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__;
1423 static _GLIBCXX_CONSTEXPR float
1424 epsilon() throw() { return __FLT_EPSILON__; }
1426 static _GLIBCXX_CONSTEXPR float
1427 round_error() throw() { return 0.5F; }
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__;
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;
1442 static _GLIBCXX_CONSTEXPR float
1443 infinity() throw() { return __builtin_huge_valf (); }
1445 static _GLIBCXX_CONSTEXPR float
1446 quiet_NaN() throw() { return __builtin_nanf (""); }
1448 static _GLIBCXX_CONSTEXPR float
1449 signaling_NaN() throw() { return __builtin_nansf (""); }
1451 static _GLIBCXX_CONSTEXPR float
1452 denorm_min() throw() { return __FLT_DENORM_MIN__; }
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;
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
1466 #undef __glibcxx_float_has_denorm_loss
1467 #undef __glibcxx_float_traps
1468 #undef __glibcxx_float_tinyness_before
1470 /// numeric_limits<double> specialization.
1472 struct numeric_limits<double>
1474 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
1476 static _GLIBCXX_CONSTEXPR double
1477 min() throw() { return __DBL_MIN__; }
1479 static _GLIBCXX_CONSTEXPR double
1480 max() throw() { return __DBL_MAX__; }
1482 #ifdef __GXX_EXPERIMENTAL_CXX0X__
1483 static constexpr double
1484 lowest() throw() { return -__DBL_MAX__; }
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__);
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__;
1498 static _GLIBCXX_CONSTEXPR double
1499 epsilon() throw() { return __DBL_EPSILON__; }
1501 static _GLIBCXX_CONSTEXPR double
1502 round_error() throw() { return 0.5; }
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__;
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;
1517 static _GLIBCXX_CONSTEXPR double
1518 infinity() throw() { return __builtin_huge_val(); }
1520 static _GLIBCXX_CONSTEXPR double
1521 quiet_NaN() throw() { return __builtin_nan (""); }
1523 static _GLIBCXX_CONSTEXPR double
1524 signaling_NaN() throw() { return __builtin_nans (""); }
1526 static _GLIBCXX_CONSTEXPR double
1527 denorm_min() throw() { return __DBL_DENORM_MIN__; }
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;
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
1541 #undef __glibcxx_double_has_denorm_loss
1542 #undef __glibcxx_double_traps
1543 #undef __glibcxx_double_tinyness_before
1545 /// numeric_limits<long double> specialization.
1547 struct numeric_limits<long double>
1549 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
1551 static _GLIBCXX_CONSTEXPR long double
1552 min() throw() { return __LDBL_MIN__; }
1554 static _GLIBCXX_CONSTEXPR long double
1555 max() throw() { return __LDBL_MAX__; }
1557 #ifdef __GXX_EXPERIMENTAL_CXX0X__
1558 static constexpr long double
1559 lowest() throw() { return -__LDBL_MAX__; }
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__);
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__;
1573 static _GLIBCXX_CONSTEXPR long double
1574 epsilon() throw() { return __LDBL_EPSILON__; }
1576 static _GLIBCXX_CONSTEXPR long double
1577 round_error() throw() { return 0.5L; }
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__;
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;
1592 static _GLIBCXX_CONSTEXPR long double
1593 infinity() throw() { return __builtin_huge_vall (); }
1595 static _GLIBCXX_CONSTEXPR long double
1596 quiet_NaN() throw() { return __builtin_nanl (""); }
1598 static _GLIBCXX_CONSTEXPR long double
1599 signaling_NaN() throw() { return __builtin_nansl (""); }
1601 static _GLIBCXX_CONSTEXPR long double
1602 denorm_min() throw() { return __LDBL_DENORM_MIN__; }
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;
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 =
1616 #undef __glibcxx_long_double_has_denorm_loss
1617 #undef __glibcxx_long_double_traps
1618 #undef __glibcxx_long_double_tinyness_before
1620 _GLIBCXX_END_NAMESPACE
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
1629 #endif // _GLIBCXX_NUMERIC_LIMITS