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