]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/include/std/limits
arm.c (arm_legitimate_index_p): Add VFP load/store index range case.
[thirdparty/gcc.git] / libstdc++-v3 / include / std / limits
CommitLineData
94a86be0 1// The template and inlines for the numeric_limits classes. -*- C++ -*-
de96ac46 2
748086b7 3// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
2a60a9f6 4// 2008, 2009, 2010 Free Software Foundation, Inc.
de96ac46
BK
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
748086b7 9// Free Software Foundation; either version 3, or (at your option)
de96ac46
BK
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
748086b7
JJ
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/>.
de96ac46 25
0aa06b18
BK
26/** @file limits
27 * This is a Standard C++ Library header.
28 */
29
54c1bf78
BK
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
1143680e
SE
38#ifndef _GLIBCXX_NUMERIC_LIMITS
39#define _GLIBCXX_NUMERIC_LIMITS 1
54c1bf78
BK
40
41#pragma GCC system_header
42
54c1bf78
BK
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).
ce4674f2 48// From Standard C++ point of view, there are 14 such types:
54c1bf78 49// * integers
94a86be0 50// bool (1)
ce4674f2 51// char, signed char, unsigned char, wchar_t (4)
54c1bf78
BK
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//
28dac70a 61// GNU C++ understands (where supported by the host C-library)
54c1bf78
BK
62// * integer
63// long long, unsigned long long (2)
64//
ce4674f2 65// which brings us to 16 fundamental arithmetic data types in GNU C++.
54c1bf78 66//
6ad8f949 67//
54c1bf78
BK
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
585e661a
GDR
74// These values can be overridden in the target configuration file.
75// The default values are appropriate for many 32-bit targets.
54c1bf78 76
28dac70a 77// GCC only intrinsically supports modulo integral types. The only remaining
da28539c
RH
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.
2778669a
PE
80#ifndef __glibcxx_integral_traps
81# define __glibcxx_integral_traps true
54c1bf78
BK
82#endif
83
54c1bf78
BK
84// float
85//
86
28dac70a 87// Default values. Should be overridden in configuration files if necessary.
54c1bf78 88
2778669a
PE
89#ifndef __glibcxx_float_has_denorm_loss
90# define __glibcxx_float_has_denorm_loss false
54c1bf78 91#endif
2778669a
PE
92#ifndef __glibcxx_float_traps
93# define __glibcxx_float_traps false
54c1bf78 94#endif
2778669a
PE
95#ifndef __glibcxx_float_tinyness_before
96# define __glibcxx_float_tinyness_before false
54c1bf78
BK
97#endif
98
54c1bf78
BK
99// double
100
28dac70a 101// Default values. Should be overridden in configuration files if necessary.
54c1bf78 102
2778669a
PE
103#ifndef __glibcxx_double_has_denorm_loss
104# define __glibcxx_double_has_denorm_loss false
54c1bf78 105#endif
2778669a
PE
106#ifndef __glibcxx_double_traps
107# define __glibcxx_double_traps false
54c1bf78 108#endif
2778669a
PE
109#ifndef __glibcxx_double_tinyness_before
110# define __glibcxx_double_tinyness_before false
54c1bf78
BK
111#endif
112
54c1bf78
BK
113// long double
114
28dac70a 115// Default values. Should be overridden in configuration files if necessary.
54c1bf78 116
2778669a
PE
117#ifndef __glibcxx_long_double_has_denorm_loss
118# define __glibcxx_long_double_has_denorm_loss false
54c1bf78 119#endif
2778669a
PE
120#ifndef __glibcxx_long_double_traps
121# define __glibcxx_long_double_traps false
54c1bf78 122#endif
2778669a
PE
123#ifndef __glibcxx_long_double_tinyness_before
124# define __glibcxx_long_double_tinyness_before false
725dc051 125#endif
54c1bf78 126
6ad8f949
RH
127// You should not need to define any macros below this point.
128
2778669a 129#define __glibcxx_signed(T) ((T)(-1) < 0)
6ad8f949 130
2778669a
PE
131#define __glibcxx_min(T) \
132 (__glibcxx_signed (T) ? (T)1 << __glibcxx_digits (T) : (T)0)
6ad8f949 133
2778669a 134#define __glibcxx_max(T) \
6ae39fd9
ILT
135 (__glibcxx_signed (T) ? \
136 (((((T)1 << (__glibcxx_digits (T) - 1)) - 1) << 1) + 1) : ~(T)0)
6ad8f949 137
2778669a
PE
138#define __glibcxx_digits(T) \
139 (sizeof(T) * __CHAR_BIT__ - __glibcxx_signed (T))
6ad8f949
RH
140
141// The fraction 643/2136 approximates log10(2) to 7 significant digits.
2778669a 142#define __glibcxx_digits10(T) \
dd60dacd 143 (__glibcxx_digits (T) * 643L / 2136)
6ad8f949 144
018afad3 145#define __glibcxx_max_digits10(T) \
dd60dacd 146 (2 + (T) * 643L / 2136)
54c1bf78 147
3cbc7af0
BK
148_GLIBCXX_BEGIN_NAMESPACE(std)
149
bd2726e0
PE
150 /**
151 * @brief Describes the rounding style for floating-point types.
152 *
153 * This is used in the std::numeric_limits class.
154 */
6ad8f949 155 enum float_round_style
54c1bf78 156 {
bd2726e0
PE
157 round_indeterminate = -1, ///< Self-explanatory.
158 round_toward_zero = 0, ///< Self-explanatory.
159 round_to_nearest = 1, ///< To the nearest representable value.
160 round_toward_infinity = 2, ///< Self-explanatory.
161 round_toward_neg_infinity = 3 ///< Self-explanatory.
54c1bf78
BK
162 };
163
bd2726e0
PE
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 */
6ad8f949 170 enum float_denorm_style
54c1bf78 171 {
bd2726e0 172 /// Indeterminate at compile time whether denormalized values are allowed.
54c1bf78 173 denorm_indeterminate = -1,
bd2726e0 174 /// The type does not allow denormalized values.
54c1bf78 175 denorm_absent = 0,
bd2726e0 176 /// The type allows denormalized values.
54c1bf78
BK
177 denorm_present = 1
178 };
179
bd2726e0
PE
180 /**
181 * @brief Part of std::numeric_limits.
182 *
183 * The @c static @c const members are usable as integral constant
184 * expressions.
185 *
28dac70a 186 * @note This is a separate class for purposes of efficiency; you
bd2726e0
PE
187 * should only access these members as part of an instantiation
188 * of the std::numeric_limits class.
189 */
84979344
BK
190 struct __numeric_limits_base
191 {
bd2726e0 192 /** This will be true for all fundamental types (which have
94a86be0
BK
193 specializations), and false for everything else. */
194 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = false;
84979344 195
bd2726e0 196 /** The number of @c radix digits that be represented without change: for
94a86be0
BK
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
bd2726e0 201 /** The number of base 10 digits that can be represented without change. */
94a86be0
BK
202 static _GLIBCXX_USE_CONSTEXPR int digits10 = 0;
203
018afad3
ESR
204#ifdef __GXX_EXPERIMENTAL_CXX0X__
205 /** The number of base 10 digits required to ensure that values which
206 differ are always differentiated. */
94a86be0 207 static constexpr int max_digits10 = 0;
018afad3 208#endif
94a86be0 209
bd2726e0 210 /** True if the type is signed. */
94a86be0
BK
211 static _GLIBCXX_USE_CONSTEXPR bool is_signed = false;
212
bd2726e0 213 /** True if the type is integer.
018afad3 214 * Is this supposed to be <em>if the type is integral?</em> */
94a86be0
BK
215 static _GLIBCXX_USE_CONSTEXPR bool is_integer = false;
216
2a60a9f6 217 /** True if the type uses an exact representation. <em>All integer types are
94a86be0
BK
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
bd2726e0 223 /** For integer types, specifies the base of the representation. For
94a86be0
BK
224 floating types, specifies the base of the exponent representation. */
225 static _GLIBCXX_USE_CONSTEXPR int radix = 0;
84979344 226
bd2726e0 227 /** The minimum negative integer such that @c radix raised to the power of
94a86be0
BK
228 (one less than that integer) is a normalized floating point number. */
229 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
230
bd2726e0 231 /** The minimum negative integer such that 10 raised to that power is in
94a86be0
BK
232 the range of normalized floating point numbers. */
233 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0;
234
bd2726e0 235 /** The maximum positive integer such that @c radix raised to the power of
94a86be0 236 (one less than that integer) is a representable finite floating point
bd2726e0 237 number. */
94a86be0
BK
238 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0;
239
bd2726e0 240 /** The maximum positive integer such that 10 raised to that power is in
94a86be0
BK
241 the range of representable finite floating point numbers. */
242 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0;
6ad8f949 243
bd2726e0 244 /** True if the type has a representation for positive infinity. */
94a86be0
BK
245 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false;
246
bd2726e0 247 /** True if the type has a representation for a quiet (non-signaling)
94a86be0
BK
248 <em>Not a Number</em>. */
249 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false;
250
bd2726e0 251 /** True if the type has a representation for a signaling
94a86be0
BK
252 <em>Not a Number</em>. */
253 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false;
254
bd2726e0 255 /** See std::float_denorm_style for more information. */
94a86be0
BK
256 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm = denorm_absent;
257
2a60a9f6 258 /** <em>True if loss of accuracy is detected as a denormalization loss,
94a86be0
BK
259 rather than as an inexact result.</em> [18.2.1.2]/42 */
260 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
84979344 261
bd2726e0 262 /** True if-and-only-if the type adheres to the IEC 559 standard, also
94a86be0
BK
263 known as IEEE 754. (Only makes sense for floating point types.) */
264 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
265
2a60a9f6 266 /** <em>True if the set of values representable by the type is
94a86be0
BK
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
bd2726e0 271 /** True if the type is @e modulo, that is, if it is possible to add two
94a86be0
BK
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;
84979344 276
bd2726e0 277 /** True if trapping is implemented for this type. */
94a86be0
BK
278 static _GLIBCXX_USE_CONSTEXPR bool traps = false;
279
28dac70a 280 /** True if tininess is detected before rounding. (see IEC 559) */
94a86be0
BK
281 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;
282
bd2726e0 283 /** See std::float_round_style for more information. This is only
94a86be0 284 meaningful for floating types; integer types will all be
bd2726e0 285 round_toward_zero. */
94a86be0
BK
286 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style =
287 round_toward_zero;
84979344
BK
288 };
289
bd2726e0
PE
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 *
3d7c150e 298 * _GLIBCXX_RESOLVE_LIB_DEFECTS: DRs 201 and 184 (hi Gaby!) are
bd2726e0 299 * noted, but not incorporated in this documented (yet).
bd2726e0 300 */
6ad8f949
RH
301 template<typename _Tp>
302 struct numeric_limits : public __numeric_limits_base
54c1bf78 303 {
bd2726e0 304 /** The minimum finite value, or for floating types with
94a86be0
BK
305 denormalization, the minimum positive normalized value. */
306 static _GLIBCXX_CONSTEXPR _Tp
307 min() throw() { return static_cast<_Tp>(0); }
308
bd2726e0 309 /** The maximum finite value. */
94a86be0
BK
310 static _GLIBCXX_CONSTEXPR _Tp
311 max() throw() { return static_cast<_Tp>(0); }
312
018afad3
ESR
313#ifdef __GXX_EXPERIMENTAL_CXX0X__
314 /** A finite value x such that there is no other finite value y
315 * where y < x. */
94a86be0
BK
316 static constexpr _Tp
317 lowest() throw() { return static_cast<_Tp>(0); }
018afad3 318#endif
94a86be0 319
bd2726e0 320 /** The @e machine @e epsilon: the difference between 1 and the least
94a86be0
BK
321 value greater than 1 that is representable. */
322 static _GLIBCXX_CONSTEXPR _Tp
323 epsilon() throw() { return static_cast<_Tp>(0); }
324
bd2726e0 325 /** The maximum rounding error measurement (see LIA-1). */
94a86be0
BK
326 static _GLIBCXX_CONSTEXPR _Tp
327 round_error() throw() { return static_cast<_Tp>(0); }
328
bd2726e0 329 /** The representation of positive infinity, if @c has_infinity. */
94a86be0
BK
330 static _GLIBCXX_CONSTEXPR _Tp
331 infinity() throw() { return static_cast<_Tp>(0); }
2a60a9f6 332
94a86be0 333 /** The representation of a quiet <em>Not a Number</em>,
2a60a9f6 334 if @c has_quiet_NaN. */
94a86be0
BK
335 static _GLIBCXX_CONSTEXPR _Tp
336 quiet_NaN() throw() { return static_cast<_Tp>(0); }
337
2a60a9f6 338 /** The representation of a signaling <em>Not a Number</em>, if
94a86be0
BK
339 @c has_signaling_NaN. */
340 static _GLIBCXX_CONSTEXPR _Tp
341 signaling_NaN() throw() { return static_cast<_Tp>(0); }
342
bd2726e0 343 /** The minimum positive denormalized value. For types where
94a86be0 344 @c has_denorm is false, this is the minimum positive normalized
bd2726e0 345 value. */
94a86be0
BK
346 static _GLIBCXX_CONSTEXPR _Tp
347 denorm_min() throw() { return static_cast<_Tp>(0); }
54c1bf78
BK
348 };
349
ce4674f2
PC
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)
0aa06b18
BK
366
367 /// numeric_limits<bool> specialization.
54c1bf78
BK
368 template<>
369 struct numeric_limits<bool>
370 {
94a86be0
BK
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; }
54c1bf78 378
018afad3 379#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0
BK
380 static constexpr bool
381 lowest() throw() { return min(); }
018afad3 382#endif
94a86be0
BK
383 static _GLIBCXX_USE_CONSTEXPR int digits = 1;
384 static _GLIBCXX_USE_CONSTEXPR int digits10 = 0;
018afad3 385#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0 386 static constexpr int max_digits10 = 0;
018afad3 387#endif
94a86be0
BK
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;
54c1bf78
BK
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.
94a86be0
BK
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;
54c1bf78
BK
434 };
435
0aa06b18 436 /// numeric_limits<char> specialization.
54c1bf78
BK
437 template<>
438 struct numeric_limits<char>
439 {
94a86be0
BK
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); }
54c1bf78 447
018afad3 448#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0
BK
449 static constexpr char
450 lowest() throw() { return min(); }
018afad3 451#endif
54c1bf78 452
94a86be0
BK
453 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (char);
454 static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (char);
018afad3 455#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0 456 static constexpr int max_digits10 = 0;
018afad3 457#endif
94a86be0
BK
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;
54c1bf78
BK
501 };
502
0aa06b18 503 /// numeric_limits<signed char> specialization.
54c1bf78
BK
504 template<>
505 struct numeric_limits<signed char>
506 {
94a86be0
BK
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__; }
54c1bf78 514
018afad3 515#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0
BK
516 static constexpr signed char
517 lowest() throw() { return min(); }
018afad3 518#endif
54c1bf78 519
94a86be0
BK
520 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (signed char);
521 static _GLIBCXX_USE_CONSTEXPR int digits10
522 = __glibcxx_digits10 (signed char);
018afad3 523#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0 524 static constexpr int max_digits10 = 0;
018afad3 525#endif
94a86be0
BK
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;
54c1bf78
BK
569 };
570
0aa06b18 571 /// numeric_limits<unsigned char> specialization.
54c1bf78
BK
572 template<>
573 struct numeric_limits<unsigned char>
574 {
94a86be0
BK
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; }
54c1bf78 582
018afad3 583#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0
BK
584 static constexpr unsigned char
585 lowest() throw() { return min(); }
018afad3 586#endif
54c1bf78 587
94a86be0
BK
588 static _GLIBCXX_USE_CONSTEXPR int digits
589 = __glibcxx_digits (unsigned char);
590 static _GLIBCXX_USE_CONSTEXPR int digits10
591 = __glibcxx_digits10 (unsigned char);
018afad3 592#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0 593 static constexpr int max_digits10 = 0;
018afad3 594#endif
94a86be0
BK
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;
54c1bf78
BK
638 };
639
0aa06b18 640 /// numeric_limits<wchar_t> specialization.
54c1bf78
BK
641 template<>
642 struct numeric_limits<wchar_t>
643 {
94a86be0
BK
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); }
54c1bf78 651
018afad3 652#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0
BK
653 static constexpr wchar_t
654 lowest() throw() { return min(); }
018afad3 655#endif
54c1bf78 656
94a86be0
BK
657 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (wchar_t);
658 static _GLIBCXX_USE_CONSTEXPR int digits10
659 = __glibcxx_digits10 (wchar_t);
018afad3 660#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0 661 static constexpr int max_digits10 = 0;
018afad3 662#endif
94a86be0
BK
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;
54c1bf78
BK
706 };
707
5fb0445d
PC
708#ifdef __GXX_EXPERIMENTAL_CXX0X__
709 /// numeric_limits<char16_t> specialization.
710 template<>
711 struct numeric_limits<char16_t>
712 {
94a86be0
BK
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); }
5fb0445d 720
018afad3 721#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0
BK
722 static constexpr char16_t
723 lowest() throw() { return min(); }
018afad3 724#endif
5fb0445d 725
94a86be0
BK
726 static _GLIBCXX_USE_CONSTEXPR int digits
727 = __glibcxx_digits (char16_t);
728 static _GLIBCXX_USE_CONSTEXPR int digits10
729 = __glibcxx_digits10 (char16_t);
018afad3 730#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0 731 static constexpr int max_digits10 = 0;
018afad3 732#endif
94a86be0
BK
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;
5fb0445d
PC
777 };
778
779 /// numeric_limits<char32_t> specialization.
780 template<>
781 struct numeric_limits<char32_t>
782 {
94a86be0
BK
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); }
5fb0445d 790
018afad3 791#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0
BK
792 static constexpr char32_t
793 lowest() throw() { return min(); }
018afad3 794#endif
5fb0445d 795
94a86be0
BK
796 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (char32_t);
797 static _GLIBCXX_USE_CONSTEXPR int digits10
798 = __glibcxx_digits10 (char32_t);
018afad3 799#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0 800 static constexpr int max_digits10 = 0;
018afad3 801#endif
94a86be0
BK
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;
5fb0445d
PC
846 };
847#endif
848
0aa06b18 849 /// numeric_limits<short> specialization.
54c1bf78
BK
850 template<>
851 struct numeric_limits<short>
852 {
94a86be0
BK
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__; }
54c1bf78 860
018afad3 861#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0
BK
862 static constexpr short
863 lowest() throw() { return min(); }
018afad3 864#endif
54c1bf78 865
94a86be0
BK
866 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (short);
867 static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (short);
018afad3 868#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0 869 static constexpr int max_digits10 = 0;
018afad3 870#endif
94a86be0
BK
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;
54c1bf78
BK
914 };
915
0aa06b18 916 /// numeric_limits<unsigned short> specialization.
54c1bf78
BK
917 template<>
918 struct numeric_limits<unsigned short>
919 {
94a86be0
BK
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; }
54c1bf78 927
018afad3 928#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0
BK
929 static constexpr unsigned short
930 lowest() throw() { return min(); }
018afad3 931#endif
54c1bf78 932
94a86be0
BK
933 static _GLIBCXX_USE_CONSTEXPR int digits
934 = __glibcxx_digits (unsigned short);
935 static _GLIBCXX_USE_CONSTEXPR int digits10
936 = __glibcxx_digits10 (unsigned short);
018afad3 937#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0 938 static constexpr int max_digits10 = 0;
018afad3 939#endif
94a86be0
BK
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;
54c1bf78
BK
983 };
984
0aa06b18 985 /// numeric_limits<int> specialization.
54c1bf78
BK
986 template<>
987 struct numeric_limits<int>
988 {
94a86be0
BK
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__; }
54c1bf78 996
018afad3 997#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0
BK
998 static constexpr int
999 lowest() throw() { return min(); }
018afad3 1000#endif
54c1bf78 1001
94a86be0
BK
1002 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (int);
1003 static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (int);
018afad3 1004#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0 1005 static constexpr int max_digits10 = 0;
018afad3 1006#endif
94a86be0
BK
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;
54c1bf78
BK
1050 };
1051
0aa06b18 1052 /// numeric_limits<unsigned int> specialization.
54c1bf78
BK
1053 template<>
1054 struct numeric_limits<unsigned int>
1055 {
94a86be0
BK
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; }
54c1bf78 1063
018afad3 1064#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0
BK
1065 static constexpr unsigned int
1066 lowest() throw() { return min(); }
018afad3 1067#endif
54c1bf78 1068
94a86be0
BK
1069 static _GLIBCXX_USE_CONSTEXPR int digits
1070 = __glibcxx_digits (unsigned int);
1071 static _GLIBCXX_USE_CONSTEXPR int digits10
1072 = __glibcxx_digits10 (unsigned int);
018afad3 1073#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0 1074 static constexpr int max_digits10 = 0;
018afad3 1075#endif
94a86be0
BK
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;
54c1bf78
BK
1119 };
1120
0aa06b18 1121 /// numeric_limits<long> specialization.
54c1bf78
BK
1122 template<>
1123 struct numeric_limits<long>
1124 {
94a86be0
BK
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__; }
54c1bf78 1132
018afad3 1133#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0
BK
1134 static constexpr long
1135 lowest() throw() { return min(); }
018afad3 1136#endif
54c1bf78 1137
94a86be0
BK
1138 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (long);
1139 static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (long);
018afad3 1140#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0 1141 static constexpr int max_digits10 = 0;
018afad3 1142#endif
94a86be0
BK
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;
54c1bf78
BK
1186 };
1187
0aa06b18 1188 /// numeric_limits<unsigned long> specialization.
54c1bf78
BK
1189 template<>
1190 struct numeric_limits<unsigned long>
1191 {
94a86be0
BK
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; }
54c1bf78 1199
018afad3 1200#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0
BK
1201 static constexpr unsigned long
1202 lowest() throw() { return min(); }
018afad3 1203#endif
54c1bf78 1204
94a86be0
BK
1205 static _GLIBCXX_USE_CONSTEXPR int digits
1206 = __glibcxx_digits (unsigned long);
1207 static _GLIBCXX_USE_CONSTEXPR int digits10
1208 = __glibcxx_digits10 (unsigned long);
018afad3 1209#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0 1210 static constexpr int max_digits10 = 0;
018afad3 1211#endif
94a86be0
BK
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;
54c1bf78
BK
1255 };
1256
0aa06b18 1257 /// numeric_limits<long long> specialization.
54c1bf78
BK
1258 template<>
1259 struct numeric_limits<long long>
1260 {
94a86be0
BK
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__; }
6ad8f949 1268
018afad3 1269#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0
BK
1270 static constexpr long long
1271 lowest() throw() { return min(); }
018afad3 1272#endif
6ad8f949 1273
94a86be0
BK
1274 static _GLIBCXX_USE_CONSTEXPR int digits
1275 = __glibcxx_digits (long long);
1276 static _GLIBCXX_USE_CONSTEXPR int digits10
1277 = __glibcxx_digits10 (long long);
018afad3 1278#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0 1279 static constexpr int max_digits10 = 0;
018afad3 1280#endif
94a86be0
BK
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;
54c1bf78
BK
1324 };
1325
0aa06b18 1326 /// numeric_limits<unsigned long long> specialization.
54c1bf78
BK
1327 template<>
1328 struct numeric_limits<unsigned long long>
1329 {
94a86be0
BK
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; }
54c1bf78 1337
018afad3 1338#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0
BK
1339 static constexpr unsigned long long
1340 lowest() throw() { return min(); }
018afad3 1341#endif
54c1bf78 1342
94a86be0
BK
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);
018afad3 1347#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0 1348 static constexpr int max_digits10 = 0;
018afad3 1349#endif
94a86be0
BK
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;
54c1bf78
BK
1393 };
1394
0aa06b18 1395 /// numeric_limits<float> specialization.
54c1bf78
BK
1396 template<>
1397 struct numeric_limits<float>
1398 {
94a86be0
BK
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__; }
54c1bf78 1406
018afad3 1407#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0
BK
1408 static constexpr float
1409 lowest() throw() { return -__FLT_MAX__; }
018afad3 1410#endif
54c1bf78 1411
94a86be0
BK
1412 static _GLIBCXX_USE_CONSTEXPR int digits = __FLT_MANT_DIG__;
1413 static _GLIBCXX_USE_CONSTEXPR int digits10 = __FLT_DIG__;
018afad3 1414#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0 1415 static constexpr int max_digits10
018afad3
ESR
1416 = __glibcxx_max_digits10 (__FLT_MANT_DIG__);
1417#endif
94a86be0
BK
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
264c41ed 1438 = bool(__FLT_HAS_DENORM__) ? denorm_present : denorm_absent;
94a86be0
BK
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 (); }
54c1bf78 1444
94a86be0
BK
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;
54c1bf78
BK
1464 };
1465
2778669a
PE
1466#undef __glibcxx_float_has_denorm_loss
1467#undef __glibcxx_float_traps
1468#undef __glibcxx_float_tinyness_before
54c1bf78 1469
0aa06b18 1470 /// numeric_limits<double> specialization.
54c1bf78
BK
1471 template<>
1472 struct numeric_limits<double>
1473 {
94a86be0
BK
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__; }
54c1bf78 1481
018afad3 1482#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0
BK
1483 static constexpr double
1484 lowest() throw() { return -__DBL_MAX__; }
018afad3 1485#endif
54c1bf78 1486
94a86be0
BK
1487 static _GLIBCXX_USE_CONSTEXPR int digits = __DBL_MANT_DIG__;
1488 static _GLIBCXX_USE_CONSTEXPR int digits10 = __DBL_DIG__;
018afad3 1489#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0 1490 static constexpr int max_digits10
018afad3
ESR
1491 = __glibcxx_max_digits10 (__DBL_MANT_DIG__);
1492#endif
94a86be0
BK
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
264c41ed 1513 = bool(__DBL_HAS_DENORM__) ? denorm_present : denorm_absent;
94a86be0
BK
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 (""); }
54c1bf78 1522
94a86be0
BK
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;
54c1bf78
BK
1539 };
1540
2778669a
PE
1541#undef __glibcxx_double_has_denorm_loss
1542#undef __glibcxx_double_traps
1543#undef __glibcxx_double_tinyness_before
6ad8f949 1544
0aa06b18 1545 /// numeric_limits<long double> specialization.
54c1bf78
BK
1546 template<>
1547 struct numeric_limits<long double>
1548 {
94a86be0
BK
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__; }
54c1bf78 1556
018afad3 1557#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0
BK
1558 static constexpr long double
1559 lowest() throw() { return -__LDBL_MAX__; }
018afad3 1560#endif
54c1bf78 1561
94a86be0
BK
1562 static _GLIBCXX_USE_CONSTEXPR int digits = __LDBL_MANT_DIG__;
1563 static _GLIBCXX_USE_CONSTEXPR int digits10 = __LDBL_DIG__;
018afad3 1564#ifdef __GXX_EXPERIMENTAL_CXX0X__
94a86be0 1565 static _GLIBCXX_USE_CONSTEXPR int max_digits10
018afad3
ESR
1566 = __glibcxx_max_digits10 (__LDBL_MANT_DIG__);
1567#endif
94a86be0
BK
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
264c41ed 1588 = bool(__LDBL_HAS_DENORM__) ? denorm_present : denorm_absent;
94a86be0 1589 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss
2778669a 1590 = __glibcxx_long_double_has_denorm_loss;
54c1bf78 1591
94a86be0
BK
1592 static _GLIBCXX_CONSTEXPR long double
1593 infinity() throw() { return __builtin_huge_vall (); }
54c1bf78 1594
94a86be0
BK
1595 static _GLIBCXX_CONSTEXPR long double
1596 quiet_NaN() throw() { return __builtin_nanl (""); }
54c1bf78 1597
94a86be0
BK
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;
54c1bf78
BK
1614 };
1615
2778669a
PE
1616#undef __glibcxx_long_double_has_denorm_loss
1617#undef __glibcxx_long_double_traps
1618#undef __glibcxx_long_double_tinyness_before
be71ea9d 1619
3cbc7af0 1620_GLIBCXX_END_NAMESPACE
54c1bf78 1621
2778669a
PE
1622#undef __glibcxx_signed
1623#undef __glibcxx_min
1624#undef __glibcxx_max
1625#undef __glibcxx_digits
1626#undef __glibcxx_digits10
018afad3 1627#undef __glibcxx_max_digits10
6ad8f949 1628
1143680e 1629#endif // _GLIBCXX_NUMERIC_LIMITS