libstdc++
|
00001 // The template and inlines for the numeric_limits classes. -*- C++ -*- 00002 00003 // Copyright (C) 1999-2018 Free Software Foundation, Inc. 00004 // 00005 // This file is part of the GNU ISO C++ Library. This library is free 00006 // software; you can redistribute it and/or modify it under the 00007 // terms of the GNU General Public License as published by the 00008 // Free Software Foundation; either version 3, or (at your option) 00009 // any later version. 00010 00011 // This library is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 // GNU General Public License for more details. 00015 00016 // Under Section 7 of GPL version 3, you are granted additional 00017 // permissions described in the GCC Runtime Library Exception, version 00018 // 3.1, as published by the Free Software Foundation. 00019 00020 // You should have received a copy of the GNU General Public License and 00021 // a copy of the GCC Runtime Library Exception along with this program; 00022 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see 00023 // <http://www.gnu.org/licenses/>. 00024 00025 /** @file include/limits 00026 * This is a Standard C++ Library header. 00027 */ 00028 00029 // Note: this is not a conforming implementation. 00030 // Written by Gabriel Dos Reis <gdr@codesourcery.com> 00031 00032 // 00033 // ISO 14882:1998 00034 // 18.2.1 00035 // 00036 00037 #ifndef _GLIBCXX_NUMERIC_LIMITS 00038 #define _GLIBCXX_NUMERIC_LIMITS 1 00039 00040 #pragma GCC system_header 00041 00042 #include <bits/c++config.h> 00043 00044 // 00045 // The numeric_limits<> traits document implementation-defined aspects 00046 // of fundamental arithmetic data types (integers and floating points). 00047 // From Standard C++ point of view, there are 14 such types: 00048 // * integers 00049 // bool (1) 00050 // char, signed char, unsigned char, wchar_t (4) 00051 // short, unsigned short (2) 00052 // int, unsigned (2) 00053 // long, unsigned long (2) 00054 // 00055 // * floating points 00056 // float (1) 00057 // double (1) 00058 // long double (1) 00059 // 00060 // GNU C++ understands (where supported by the host C-library) 00061 // * integer 00062 // long long, unsigned long long (2) 00063 // 00064 // which brings us to 16 fundamental arithmetic data types in GNU C++. 00065 // 00066 // 00067 // Since a numeric_limits<> is a bit tricky to get right, we rely on 00068 // an interface composed of macros which should be defined in config/os 00069 // or config/cpu when they differ from the generic (read arbitrary) 00070 // definitions given here. 00071 // 00072 00073 // These values can be overridden in the target configuration file. 00074 // The default values are appropriate for many 32-bit targets. 00075 00076 // GCC only intrinsically supports modulo integral types. The only remaining 00077 // integral exceptional values is division by zero. Only targets that do not 00078 // signal division by zero in some "hard to ignore" way should use false. 00079 #ifndef __glibcxx_integral_traps 00080 # define __glibcxx_integral_traps true 00081 #endif 00082 00083 // float 00084 // 00085 00086 // Default values. Should be overridden in configuration files if necessary. 00087 00088 #ifndef __glibcxx_float_has_denorm_loss 00089 # define __glibcxx_float_has_denorm_loss false 00090 #endif 00091 #ifndef __glibcxx_float_traps 00092 # define __glibcxx_float_traps false 00093 #endif 00094 #ifndef __glibcxx_float_tinyness_before 00095 # define __glibcxx_float_tinyness_before false 00096 #endif 00097 00098 // double 00099 00100 // Default values. Should be overridden in configuration files if necessary. 00101 00102 #ifndef __glibcxx_double_has_denorm_loss 00103 # define __glibcxx_double_has_denorm_loss false 00104 #endif 00105 #ifndef __glibcxx_double_traps 00106 # define __glibcxx_double_traps false 00107 #endif 00108 #ifndef __glibcxx_double_tinyness_before 00109 # define __glibcxx_double_tinyness_before false 00110 #endif 00111 00112 // long double 00113 00114 // Default values. Should be overridden in configuration files if necessary. 00115 00116 #ifndef __glibcxx_long_double_has_denorm_loss 00117 # define __glibcxx_long_double_has_denorm_loss false 00118 #endif 00119 #ifndef __glibcxx_long_double_traps 00120 # define __glibcxx_long_double_traps false 00121 #endif 00122 #ifndef __glibcxx_long_double_tinyness_before 00123 # define __glibcxx_long_double_tinyness_before false 00124 #endif 00125 00126 // You should not need to define any macros below this point. 00127 00128 #define __glibcxx_signed_b(T,B) ((T)(-1) < 0) 00129 00130 #define __glibcxx_min_b(T,B) \ 00131 (__glibcxx_signed_b (T,B) ? -__glibcxx_max_b (T,B) - 1 : (T)0) 00132 00133 #define __glibcxx_max_b(T,B) \ 00134 (__glibcxx_signed_b (T,B) ? \ 00135 (((((T)1 << (__glibcxx_digits_b (T,B) - 1)) - 1) << 1) + 1) : ~(T)0) 00136 00137 #define __glibcxx_digits_b(T,B) \ 00138 (B - __glibcxx_signed_b (T,B)) 00139 00140 // The fraction 643/2136 approximates log10(2) to 7 significant digits. 00141 #define __glibcxx_digits10_b(T,B) \ 00142 (__glibcxx_digits_b (T,B) * 643L / 2136) 00143 00144 #define __glibcxx_signed(T) \ 00145 __glibcxx_signed_b (T, sizeof(T) * __CHAR_BIT__) 00146 #define __glibcxx_min(T) \ 00147 __glibcxx_min_b (T, sizeof(T) * __CHAR_BIT__) 00148 #define __glibcxx_max(T) \ 00149 __glibcxx_max_b (T, sizeof(T) * __CHAR_BIT__) 00150 #define __glibcxx_digits(T) \ 00151 __glibcxx_digits_b (T, sizeof(T) * __CHAR_BIT__) 00152 #define __glibcxx_digits10(T) \ 00153 __glibcxx_digits10_b (T, sizeof(T) * __CHAR_BIT__) 00154 00155 #define __glibcxx_max_digits10(T) \ 00156 (2 + (T) * 643L / 2136) 00157 00158 namespace std _GLIBCXX_VISIBILITY(default) 00159 { 00160 _GLIBCXX_BEGIN_NAMESPACE_VERSION 00161 00162 /** 00163 * @brief Describes the rounding style for floating-point types. 00164 * 00165 * This is used in the std::numeric_limits class. 00166 */ 00167 enum float_round_style 00168 { 00169 round_indeterminate = -1, /// Intermediate. 00170 round_toward_zero = 0, /// To zero. 00171 round_to_nearest = 1, /// To the nearest representable value. 00172 round_toward_infinity = 2, /// To infinity. 00173 round_toward_neg_infinity = 3 /// To negative infinity. 00174 }; 00175 00176 /** 00177 * @brief Describes the denormalization for floating-point types. 00178 * 00179 * These values represent the presence or absence of a variable number 00180 * of exponent bits. This type is used in the std::numeric_limits class. 00181 */ 00182 enum float_denorm_style 00183 { 00184 /// Indeterminate at compile time whether denormalized values are allowed. 00185 denorm_indeterminate = -1, 00186 /// The type does not allow denormalized values. 00187 denorm_absent = 0, 00188 /// The type allows denormalized values. 00189 denorm_present = 1 00190 }; 00191 00192 /** 00193 * @brief Part of std::numeric_limits. 00194 * 00195 * The @c static @c const members are usable as integral constant 00196 * expressions. 00197 * 00198 * @note This is a separate class for purposes of efficiency; you 00199 * should only access these members as part of an instantiation 00200 * of the std::numeric_limits class. 00201 */ 00202 struct __numeric_limits_base 00203 { 00204 /** This will be true for all fundamental types (which have 00205 specializations), and false for everything else. */ 00206 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = false; 00207 00208 /** The number of @c radix digits that be represented without change: for 00209 integer types, the number of non-sign bits in the mantissa; for 00210 floating types, the number of @c radix digits in the mantissa. */ 00211 static _GLIBCXX_USE_CONSTEXPR int digits = 0; 00212 00213 /** The number of base 10 digits that can be represented without change. */ 00214 static _GLIBCXX_USE_CONSTEXPR int digits10 = 0; 00215 00216 #if __cplusplus >= 201103L 00217 /** The number of base 10 digits required to ensure that values which 00218 differ are always differentiated. */ 00219 static constexpr int max_digits10 = 0; 00220 #endif 00221 00222 /** True if the type is signed. */ 00223 static _GLIBCXX_USE_CONSTEXPR bool is_signed = false; 00224 00225 /** True if the type is integer. */ 00226 static _GLIBCXX_USE_CONSTEXPR bool is_integer = false; 00227 00228 /** True if the type uses an exact representation. All integer types are 00229 exact, but not all exact types are integer. For example, rational and 00230 fixed-exponent representations are exact but not integer. */ 00231 static _GLIBCXX_USE_CONSTEXPR bool is_exact = false; 00232 00233 /** For integer types, specifies the base of the representation. For 00234 floating types, specifies the base of the exponent representation. */ 00235 static _GLIBCXX_USE_CONSTEXPR int radix = 0; 00236 00237 /** The minimum negative integer such that @c radix raised to the power of 00238 (one less than that integer) is a normalized floating point number. */ 00239 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; 00240 00241 /** The minimum negative integer such that 10 raised to that power is in 00242 the range of normalized floating point numbers. */ 00243 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; 00244 00245 /** The maximum positive integer such that @c radix raised to the power of 00246 (one less than that integer) is a representable finite floating point 00247 number. */ 00248 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; 00249 00250 /** The maximum positive integer such that 10 raised to that power is in 00251 the range of representable finite floating point numbers. */ 00252 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; 00253 00254 /** True if the type has a representation for positive infinity. */ 00255 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; 00256 00257 /** True if the type has a representation for a quiet (non-signaling) 00258 Not a Number. */ 00259 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; 00260 00261 /** True if the type has a representation for a signaling 00262 Not a Number. */ 00263 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; 00264 00265 /** See std::float_denorm_style for more information. */ 00266 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm = denorm_absent; 00267 00268 /** True if loss of accuracy is detected as a denormalization loss, 00269 rather than as an inexact result. */ 00270 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; 00271 00272 /** True if-and-only-if the type adheres to the IEC 559 standard, also 00273 known as IEEE 754. (Only makes sense for floating point types.) */ 00274 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; 00275 00276 /** True if the set of values representable by the type is 00277 finite. All built-in types are bounded, this member would be 00278 false for arbitrary precision types. */ 00279 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = false; 00280 00281 /** True if the type is @e modulo. A type is modulo if, for any 00282 operation involving +, -, or * on values of that type whose 00283 result would fall outside the range [min(),max()], the value 00284 returned differs from the true value by an integer multiple of 00285 max() - min() + 1. On most machines, this is false for floating 00286 types, true for unsigned integers, and true for signed integers. 00287 See PR22200 about signed integers. */ 00288 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; 00289 00290 /** True if trapping is implemented for this type. */ 00291 static _GLIBCXX_USE_CONSTEXPR bool traps = false; 00292 00293 /** True if tininess is detected before rounding. (see IEC 559) */ 00294 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; 00295 00296 /** See std::float_round_style for more information. This is only 00297 meaningful for floating types; integer types will all be 00298 round_toward_zero. */ 00299 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style = 00300 round_toward_zero; 00301 }; 00302 00303 /** 00304 * @brief Properties of fundamental types. 00305 * 00306 * This class allows a program to obtain information about the 00307 * representation of a fundamental type on a given platform. For 00308 * non-fundamental types, the functions will return 0 and the data 00309 * members will all be @c false. 00310 */ 00311 template<typename _Tp> 00312 struct numeric_limits : public __numeric_limits_base 00313 { 00314 /** The minimum finite value, or for floating types with 00315 denormalization, the minimum positive normalized value. */ 00316 static _GLIBCXX_CONSTEXPR _Tp 00317 min() _GLIBCXX_USE_NOEXCEPT { return _Tp(); } 00318 00319 /** The maximum finite value. */ 00320 static _GLIBCXX_CONSTEXPR _Tp 00321 max() _GLIBCXX_USE_NOEXCEPT { return _Tp(); } 00322 00323 #if __cplusplus >= 201103L 00324 /** A finite value x such that there is no other finite value y 00325 * where y < x. */ 00326 static constexpr _Tp 00327 lowest() noexcept { return _Tp(); } 00328 #endif 00329 00330 /** The @e machine @e epsilon: the difference between 1 and the least 00331 value greater than 1 that is representable. */ 00332 static _GLIBCXX_CONSTEXPR _Tp 00333 epsilon() _GLIBCXX_USE_NOEXCEPT { return _Tp(); } 00334 00335 /** The maximum rounding error measurement (see LIA-1). */ 00336 static _GLIBCXX_CONSTEXPR _Tp 00337 round_error() _GLIBCXX_USE_NOEXCEPT { return _Tp(); } 00338 00339 /** The representation of positive infinity, if @c has_infinity. */ 00340 static _GLIBCXX_CONSTEXPR _Tp 00341 infinity() _GLIBCXX_USE_NOEXCEPT { return _Tp(); } 00342 00343 /** The representation of a quiet Not a Number, 00344 if @c has_quiet_NaN. */ 00345 static _GLIBCXX_CONSTEXPR _Tp 00346 quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return _Tp(); } 00347 00348 /** The representation of a signaling Not a Number, if 00349 @c has_signaling_NaN. */ 00350 static _GLIBCXX_CONSTEXPR _Tp 00351 signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return _Tp(); } 00352 00353 /** The minimum positive denormalized value. For types where 00354 @c has_denorm is false, this is the minimum positive normalized 00355 value. */ 00356 static _GLIBCXX_CONSTEXPR _Tp 00357 denorm_min() _GLIBCXX_USE_NOEXCEPT { return _Tp(); } 00358 }; 00359 00360 // _GLIBCXX_RESOLVE_LIB_DEFECTS 00361 // 559. numeric_limits<const T> 00362 00363 template<typename _Tp> 00364 struct numeric_limits<const _Tp> 00365 : public numeric_limits<_Tp> { }; 00366 00367 template<typename _Tp> 00368 struct numeric_limits<volatile _Tp> 00369 : public numeric_limits<_Tp> { }; 00370 00371 template<typename _Tp> 00372 struct numeric_limits<const volatile _Tp> 00373 : public numeric_limits<_Tp> { }; 00374 00375 // Now there follow 16 explicit specializations. Yes, 16. Make sure 00376 // you get the count right. (18 in C++11 mode, with char16_t and char32_t.) 00377 00378 // _GLIBCXX_RESOLVE_LIB_DEFECTS 00379 // 184. numeric_limits<bool> wording problems 00380 00381 /// numeric_limits<bool> specialization. 00382 template<> 00383 struct numeric_limits<bool> 00384 { 00385 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; 00386 00387 static _GLIBCXX_CONSTEXPR bool 00388 min() _GLIBCXX_USE_NOEXCEPT { return false; } 00389 00390 static _GLIBCXX_CONSTEXPR bool 00391 max() _GLIBCXX_USE_NOEXCEPT { return true; } 00392 00393 #if __cplusplus >= 201103L 00394 static constexpr bool 00395 lowest() noexcept { return min(); } 00396 #endif 00397 static _GLIBCXX_USE_CONSTEXPR int digits = 1; 00398 static _GLIBCXX_USE_CONSTEXPR int digits10 = 0; 00399 #if __cplusplus >= 201103L 00400 static constexpr int max_digits10 = 0; 00401 #endif 00402 static _GLIBCXX_USE_CONSTEXPR bool is_signed = false; 00403 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; 00404 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; 00405 static _GLIBCXX_USE_CONSTEXPR int radix = 2; 00406 00407 static _GLIBCXX_CONSTEXPR bool 00408 epsilon() _GLIBCXX_USE_NOEXCEPT { return false; } 00409 00410 static _GLIBCXX_CONSTEXPR bool 00411 round_error() _GLIBCXX_USE_NOEXCEPT { return false; } 00412 00413 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; 00414 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; 00415 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; 00416 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; 00417 00418 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; 00419 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; 00420 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; 00421 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm 00422 = denorm_absent; 00423 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; 00424 00425 static _GLIBCXX_CONSTEXPR bool 00426 infinity() _GLIBCXX_USE_NOEXCEPT { return false; } 00427 00428 static _GLIBCXX_CONSTEXPR bool 00429 quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return false; } 00430 00431 static _GLIBCXX_CONSTEXPR bool 00432 signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return false; } 00433 00434 static _GLIBCXX_CONSTEXPR bool 00435 denorm_min() _GLIBCXX_USE_NOEXCEPT { return false; } 00436 00437 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; 00438 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; 00439 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; 00440 00441 // It is not clear what it means for a boolean type to trap. 00442 // This is a DR on the LWG issue list. Here, I use integer 00443 // promotion semantics. 00444 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; 00445 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; 00446 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style 00447 = round_toward_zero; 00448 }; 00449 00450 /// numeric_limits<char> specialization. 00451 template<> 00452 struct numeric_limits<char> 00453 { 00454 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; 00455 00456 static _GLIBCXX_CONSTEXPR char 00457 min() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_min(char); } 00458 00459 static _GLIBCXX_CONSTEXPR char 00460 max() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_max(char); } 00461 00462 #if __cplusplus >= 201103L 00463 static constexpr char 00464 lowest() noexcept { return min(); } 00465 #endif 00466 00467 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (char); 00468 static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (char); 00469 #if __cplusplus >= 201103L 00470 static constexpr int max_digits10 = 0; 00471 #endif 00472 static _GLIBCXX_USE_CONSTEXPR bool is_signed = __glibcxx_signed (char); 00473 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; 00474 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; 00475 static _GLIBCXX_USE_CONSTEXPR int radix = 2; 00476 00477 static _GLIBCXX_CONSTEXPR char 00478 epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } 00479 00480 static _GLIBCXX_CONSTEXPR char 00481 round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } 00482 00483 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; 00484 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; 00485 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; 00486 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; 00487 00488 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; 00489 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; 00490 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; 00491 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm 00492 = denorm_absent; 00493 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; 00494 00495 static _GLIBCXX_CONSTEXPR 00496 char infinity() _GLIBCXX_USE_NOEXCEPT { return char(); } 00497 00498 static _GLIBCXX_CONSTEXPR char 00499 quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return char(); } 00500 00501 static _GLIBCXX_CONSTEXPR char 00502 signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return char(); } 00503 00504 static _GLIBCXX_CONSTEXPR char 00505 denorm_min() _GLIBCXX_USE_NOEXCEPT { return static_cast<char>(0); } 00506 00507 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; 00508 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; 00509 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = !is_signed; 00510 00511 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; 00512 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; 00513 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style 00514 = round_toward_zero; 00515 }; 00516 00517 /// numeric_limits<signed char> specialization. 00518 template<> 00519 struct numeric_limits<signed char> 00520 { 00521 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; 00522 00523 static _GLIBCXX_CONSTEXPR signed char 00524 min() _GLIBCXX_USE_NOEXCEPT { return -__SCHAR_MAX__ - 1; } 00525 00526 static _GLIBCXX_CONSTEXPR signed char 00527 max() _GLIBCXX_USE_NOEXCEPT { return __SCHAR_MAX__; } 00528 00529 #if __cplusplus >= 201103L 00530 static constexpr signed char 00531 lowest() noexcept { return min(); } 00532 #endif 00533 00534 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (signed char); 00535 static _GLIBCXX_USE_CONSTEXPR int digits10 00536 = __glibcxx_digits10 (signed char); 00537 #if __cplusplus >= 201103L 00538 static constexpr int max_digits10 = 0; 00539 #endif 00540 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true; 00541 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; 00542 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; 00543 static _GLIBCXX_USE_CONSTEXPR int radix = 2; 00544 00545 static _GLIBCXX_CONSTEXPR signed char 00546 epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } 00547 00548 static _GLIBCXX_CONSTEXPR signed char 00549 round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } 00550 00551 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; 00552 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; 00553 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; 00554 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; 00555 00556 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; 00557 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; 00558 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; 00559 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm 00560 = denorm_absent; 00561 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; 00562 00563 static _GLIBCXX_CONSTEXPR signed char 00564 infinity() _GLIBCXX_USE_NOEXCEPT { return static_cast<signed char>(0); } 00565 00566 static _GLIBCXX_CONSTEXPR signed char 00567 quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast<signed char>(0); } 00568 00569 static _GLIBCXX_CONSTEXPR signed char 00570 signaling_NaN() _GLIBCXX_USE_NOEXCEPT 00571 { return static_cast<signed char>(0); } 00572 00573 static _GLIBCXX_CONSTEXPR signed char 00574 denorm_min() _GLIBCXX_USE_NOEXCEPT 00575 { return static_cast<signed char>(0); } 00576 00577 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; 00578 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; 00579 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; 00580 00581 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; 00582 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; 00583 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style 00584 = round_toward_zero; 00585 }; 00586 00587 /// numeric_limits<unsigned char> specialization. 00588 template<> 00589 struct numeric_limits<unsigned char> 00590 { 00591 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; 00592 00593 static _GLIBCXX_CONSTEXPR unsigned char 00594 min() _GLIBCXX_USE_NOEXCEPT { return 0; } 00595 00596 static _GLIBCXX_CONSTEXPR unsigned char 00597 max() _GLIBCXX_USE_NOEXCEPT { return __SCHAR_MAX__ * 2U + 1; } 00598 00599 #if __cplusplus >= 201103L 00600 static constexpr unsigned char 00601 lowest() noexcept { return min(); } 00602 #endif 00603 00604 static _GLIBCXX_USE_CONSTEXPR int digits 00605 = __glibcxx_digits (unsigned char); 00606 static _GLIBCXX_USE_CONSTEXPR int digits10 00607 = __glibcxx_digits10 (unsigned char); 00608 #if __cplusplus >= 201103L 00609 static constexpr int max_digits10 = 0; 00610 #endif 00611 static _GLIBCXX_USE_CONSTEXPR bool is_signed = false; 00612 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; 00613 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; 00614 static _GLIBCXX_USE_CONSTEXPR int radix = 2; 00615 00616 static _GLIBCXX_CONSTEXPR unsigned char 00617 epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } 00618 00619 static _GLIBCXX_CONSTEXPR unsigned char 00620 round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } 00621 00622 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; 00623 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; 00624 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; 00625 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; 00626 00627 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; 00628 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; 00629 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; 00630 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm 00631 = denorm_absent; 00632 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; 00633 00634 static _GLIBCXX_CONSTEXPR unsigned char 00635 infinity() _GLIBCXX_USE_NOEXCEPT 00636 { return static_cast<unsigned char>(0); } 00637 00638 static _GLIBCXX_CONSTEXPR unsigned char 00639 quiet_NaN() _GLIBCXX_USE_NOEXCEPT 00640 { return static_cast<unsigned char>(0); } 00641 00642 static _GLIBCXX_CONSTEXPR unsigned char 00643 signaling_NaN() _GLIBCXX_USE_NOEXCEPT 00644 { return static_cast<unsigned char>(0); } 00645 00646 static _GLIBCXX_CONSTEXPR unsigned char 00647 denorm_min() _GLIBCXX_USE_NOEXCEPT 00648 { return static_cast<unsigned char>(0); } 00649 00650 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; 00651 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; 00652 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true; 00653 00654 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; 00655 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; 00656 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style 00657 = round_toward_zero; 00658 }; 00659 00660 /// numeric_limits<wchar_t> specialization. 00661 template<> 00662 struct numeric_limits<wchar_t> 00663 { 00664 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; 00665 00666 static _GLIBCXX_CONSTEXPR wchar_t 00667 min() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_min (wchar_t); } 00668 00669 static _GLIBCXX_CONSTEXPR wchar_t 00670 max() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_max (wchar_t); } 00671 00672 #if __cplusplus >= 201103L 00673 static constexpr wchar_t 00674 lowest() noexcept { return min(); } 00675 #endif 00676 00677 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (wchar_t); 00678 static _GLIBCXX_USE_CONSTEXPR int digits10 00679 = __glibcxx_digits10 (wchar_t); 00680 #if __cplusplus >= 201103L 00681 static constexpr int max_digits10 = 0; 00682 #endif 00683 static _GLIBCXX_USE_CONSTEXPR bool is_signed = __glibcxx_signed (wchar_t); 00684 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; 00685 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; 00686 static _GLIBCXX_USE_CONSTEXPR int radix = 2; 00687 00688 static _GLIBCXX_CONSTEXPR wchar_t 00689 epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } 00690 00691 static _GLIBCXX_CONSTEXPR wchar_t 00692 round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } 00693 00694 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; 00695 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; 00696 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; 00697 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; 00698 00699 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; 00700 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; 00701 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; 00702 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm 00703 = denorm_absent; 00704 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; 00705 00706 static _GLIBCXX_CONSTEXPR wchar_t 00707 infinity() _GLIBCXX_USE_NOEXCEPT { return wchar_t(); } 00708 00709 static _GLIBCXX_CONSTEXPR wchar_t 00710 quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return wchar_t(); } 00711 00712 static _GLIBCXX_CONSTEXPR wchar_t 00713 signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return wchar_t(); } 00714 00715 static _GLIBCXX_CONSTEXPR wchar_t 00716 denorm_min() _GLIBCXX_USE_NOEXCEPT { return wchar_t(); } 00717 00718 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; 00719 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; 00720 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = !is_signed; 00721 00722 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; 00723 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; 00724 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style 00725 = round_toward_zero; 00726 }; 00727 00728 #if __cplusplus >= 201103L 00729 /// numeric_limits<char16_t> specialization. 00730 template<> 00731 struct numeric_limits<char16_t> 00732 { 00733 static constexpr bool is_specialized = true; 00734 00735 static constexpr char16_t 00736 min() noexcept { return __glibcxx_min (char16_t); } 00737 00738 static constexpr char16_t 00739 max() noexcept { return __glibcxx_max (char16_t); } 00740 00741 static constexpr char16_t 00742 lowest() noexcept { return min(); } 00743 00744 static constexpr int digits = __glibcxx_digits (char16_t); 00745 static constexpr int digits10 = __glibcxx_digits10 (char16_t); 00746 static constexpr int max_digits10 = 0; 00747 static constexpr bool is_signed = __glibcxx_signed (char16_t); 00748 static constexpr bool is_integer = true; 00749 static constexpr bool is_exact = true; 00750 static constexpr int radix = 2; 00751 00752 static constexpr char16_t 00753 epsilon() noexcept { return 0; } 00754 00755 static constexpr char16_t 00756 round_error() noexcept { return 0; } 00757 00758 static constexpr int min_exponent = 0; 00759 static constexpr int min_exponent10 = 0; 00760 static constexpr int max_exponent = 0; 00761 static constexpr int max_exponent10 = 0; 00762 00763 static constexpr bool has_infinity = false; 00764 static constexpr bool has_quiet_NaN = false; 00765 static constexpr bool has_signaling_NaN = false; 00766 static constexpr float_denorm_style has_denorm = denorm_absent; 00767 static constexpr bool has_denorm_loss = false; 00768 00769 static constexpr char16_t 00770 infinity() noexcept { return char16_t(); } 00771 00772 static constexpr char16_t 00773 quiet_NaN() noexcept { return char16_t(); } 00774 00775 static constexpr char16_t 00776 signaling_NaN() noexcept { return char16_t(); } 00777 00778 static constexpr char16_t 00779 denorm_min() noexcept { return char16_t(); } 00780 00781 static constexpr bool is_iec559 = false; 00782 static constexpr bool is_bounded = true; 00783 static constexpr bool is_modulo = !is_signed; 00784 00785 static constexpr bool traps = __glibcxx_integral_traps; 00786 static constexpr bool tinyness_before = false; 00787 static constexpr float_round_style round_style = round_toward_zero; 00788 }; 00789 00790 /// numeric_limits<char32_t> specialization. 00791 template<> 00792 struct numeric_limits<char32_t> 00793 { 00794 static constexpr bool is_specialized = true; 00795 00796 static constexpr char32_t 00797 min() noexcept { return __glibcxx_min (char32_t); } 00798 00799 static constexpr char32_t 00800 max() noexcept { return __glibcxx_max (char32_t); } 00801 00802 static constexpr char32_t 00803 lowest() noexcept { return min(); } 00804 00805 static constexpr int digits = __glibcxx_digits (char32_t); 00806 static constexpr int digits10 = __glibcxx_digits10 (char32_t); 00807 static constexpr int max_digits10 = 0; 00808 static constexpr bool is_signed = __glibcxx_signed (char32_t); 00809 static constexpr bool is_integer = true; 00810 static constexpr bool is_exact = true; 00811 static constexpr int radix = 2; 00812 00813 static constexpr char32_t 00814 epsilon() noexcept { return 0; } 00815 00816 static constexpr char32_t 00817 round_error() noexcept { return 0; } 00818 00819 static constexpr int min_exponent = 0; 00820 static constexpr int min_exponent10 = 0; 00821 static constexpr int max_exponent = 0; 00822 static constexpr int max_exponent10 = 0; 00823 00824 static constexpr bool has_infinity = false; 00825 static constexpr bool has_quiet_NaN = false; 00826 static constexpr bool has_signaling_NaN = false; 00827 static constexpr float_denorm_style has_denorm = denorm_absent; 00828 static constexpr bool has_denorm_loss = false; 00829 00830 static constexpr char32_t 00831 infinity() noexcept { return char32_t(); } 00832 00833 static constexpr char32_t 00834 quiet_NaN() noexcept { return char32_t(); } 00835 00836 static constexpr char32_t 00837 signaling_NaN() noexcept { return char32_t(); } 00838 00839 static constexpr char32_t 00840 denorm_min() noexcept { return char32_t(); } 00841 00842 static constexpr bool is_iec559 = false; 00843 static constexpr bool is_bounded = true; 00844 static constexpr bool is_modulo = !is_signed; 00845 00846 static constexpr bool traps = __glibcxx_integral_traps; 00847 static constexpr bool tinyness_before = false; 00848 static constexpr float_round_style round_style = round_toward_zero; 00849 }; 00850 #endif 00851 00852 /// numeric_limits<short> specialization. 00853 template<> 00854 struct numeric_limits<short> 00855 { 00856 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; 00857 00858 static _GLIBCXX_CONSTEXPR short 00859 min() _GLIBCXX_USE_NOEXCEPT { return -__SHRT_MAX__ - 1; } 00860 00861 static _GLIBCXX_CONSTEXPR short 00862 max() _GLIBCXX_USE_NOEXCEPT { return __SHRT_MAX__; } 00863 00864 #if __cplusplus >= 201103L 00865 static constexpr short 00866 lowest() noexcept { return min(); } 00867 #endif 00868 00869 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (short); 00870 static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (short); 00871 #if __cplusplus >= 201103L 00872 static constexpr int max_digits10 = 0; 00873 #endif 00874 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true; 00875 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; 00876 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; 00877 static _GLIBCXX_USE_CONSTEXPR int radix = 2; 00878 00879 static _GLIBCXX_CONSTEXPR short 00880 epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } 00881 00882 static _GLIBCXX_CONSTEXPR short 00883 round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } 00884 00885 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; 00886 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; 00887 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; 00888 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; 00889 00890 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; 00891 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; 00892 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; 00893 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm 00894 = denorm_absent; 00895 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; 00896 00897 static _GLIBCXX_CONSTEXPR short 00898 infinity() _GLIBCXX_USE_NOEXCEPT { return short(); } 00899 00900 static _GLIBCXX_CONSTEXPR short 00901 quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return short(); } 00902 00903 static _GLIBCXX_CONSTEXPR short 00904 signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return short(); } 00905 00906 static _GLIBCXX_CONSTEXPR short 00907 denorm_min() _GLIBCXX_USE_NOEXCEPT { return short(); } 00908 00909 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; 00910 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; 00911 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; 00912 00913 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; 00914 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; 00915 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style 00916 = round_toward_zero; 00917 }; 00918 00919 /// numeric_limits<unsigned short> specialization. 00920 template<> 00921 struct numeric_limits<unsigned short> 00922 { 00923 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; 00924 00925 static _GLIBCXX_CONSTEXPR unsigned short 00926 min() _GLIBCXX_USE_NOEXCEPT { return 0; } 00927 00928 static _GLIBCXX_CONSTEXPR unsigned short 00929 max() _GLIBCXX_USE_NOEXCEPT { return __SHRT_MAX__ * 2U + 1; } 00930 00931 #if __cplusplus >= 201103L 00932 static constexpr unsigned short 00933 lowest() noexcept { return min(); } 00934 #endif 00935 00936 static _GLIBCXX_USE_CONSTEXPR int digits 00937 = __glibcxx_digits (unsigned short); 00938 static _GLIBCXX_USE_CONSTEXPR int digits10 00939 = __glibcxx_digits10 (unsigned short); 00940 #if __cplusplus >= 201103L 00941 static constexpr int max_digits10 = 0; 00942 #endif 00943 static _GLIBCXX_USE_CONSTEXPR bool is_signed = false; 00944 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; 00945 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; 00946 static _GLIBCXX_USE_CONSTEXPR int radix = 2; 00947 00948 static _GLIBCXX_CONSTEXPR unsigned short 00949 epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } 00950 00951 static _GLIBCXX_CONSTEXPR unsigned short 00952 round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } 00953 00954 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; 00955 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; 00956 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; 00957 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; 00958 00959 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; 00960 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; 00961 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; 00962 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm 00963 = denorm_absent; 00964 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; 00965 00966 static _GLIBCXX_CONSTEXPR unsigned short 00967 infinity() _GLIBCXX_USE_NOEXCEPT 00968 { return static_cast<unsigned short>(0); } 00969 00970 static _GLIBCXX_CONSTEXPR unsigned short 00971 quiet_NaN() _GLIBCXX_USE_NOEXCEPT 00972 { return static_cast<unsigned short>(0); } 00973 00974 static _GLIBCXX_CONSTEXPR unsigned short 00975 signaling_NaN() _GLIBCXX_USE_NOEXCEPT 00976 { return static_cast<unsigned short>(0); } 00977 00978 static _GLIBCXX_CONSTEXPR unsigned short 00979 denorm_min() _GLIBCXX_USE_NOEXCEPT 00980 { return static_cast<unsigned short>(0); } 00981 00982 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; 00983 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; 00984 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true; 00985 00986 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; 00987 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; 00988 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style 00989 = round_toward_zero; 00990 }; 00991 00992 /// numeric_limits<int> specialization. 00993 template<> 00994 struct numeric_limits<int> 00995 { 00996 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; 00997 00998 static _GLIBCXX_CONSTEXPR int 00999 min() _GLIBCXX_USE_NOEXCEPT { return -__INT_MAX__ - 1; } 01000 01001 static _GLIBCXX_CONSTEXPR int 01002 max() _GLIBCXX_USE_NOEXCEPT { return __INT_MAX__; } 01003 01004 #if __cplusplus >= 201103L 01005 static constexpr int 01006 lowest() noexcept { return min(); } 01007 #endif 01008 01009 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (int); 01010 static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (int); 01011 #if __cplusplus >= 201103L 01012 static constexpr int max_digits10 = 0; 01013 #endif 01014 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true; 01015 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; 01016 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; 01017 static _GLIBCXX_USE_CONSTEXPR int radix = 2; 01018 01019 static _GLIBCXX_CONSTEXPR int 01020 epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } 01021 01022 static _GLIBCXX_CONSTEXPR int 01023 round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } 01024 01025 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; 01026 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; 01027 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; 01028 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; 01029 01030 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; 01031 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; 01032 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; 01033 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm 01034 = denorm_absent; 01035 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; 01036 01037 static _GLIBCXX_CONSTEXPR int 01038 infinity() _GLIBCXX_USE_NOEXCEPT { return static_cast<int>(0); } 01039 01040 static _GLIBCXX_CONSTEXPR int 01041 quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast<int>(0); } 01042 01043 static _GLIBCXX_CONSTEXPR int 01044 signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast<int>(0); } 01045 01046 static _GLIBCXX_CONSTEXPR int 01047 denorm_min() _GLIBCXX_USE_NOEXCEPT { return static_cast<int>(0); } 01048 01049 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; 01050 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; 01051 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; 01052 01053 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; 01054 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; 01055 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style 01056 = round_toward_zero; 01057 }; 01058 01059 /// numeric_limits<unsigned int> specialization. 01060 template<> 01061 struct numeric_limits<unsigned int> 01062 { 01063 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; 01064 01065 static _GLIBCXX_CONSTEXPR unsigned int 01066 min() _GLIBCXX_USE_NOEXCEPT { return 0; } 01067 01068 static _GLIBCXX_CONSTEXPR unsigned int 01069 max() _GLIBCXX_USE_NOEXCEPT { return __INT_MAX__ * 2U + 1; } 01070 01071 #if __cplusplus >= 201103L 01072 static constexpr unsigned int 01073 lowest() noexcept { return min(); } 01074 #endif 01075 01076 static _GLIBCXX_USE_CONSTEXPR int digits 01077 = __glibcxx_digits (unsigned int); 01078 static _GLIBCXX_USE_CONSTEXPR int digits10 01079 = __glibcxx_digits10 (unsigned int); 01080 #if __cplusplus >= 201103L 01081 static constexpr int max_digits10 = 0; 01082 #endif 01083 static _GLIBCXX_USE_CONSTEXPR bool is_signed = false; 01084 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; 01085 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; 01086 static _GLIBCXX_USE_CONSTEXPR int radix = 2; 01087 01088 static _GLIBCXX_CONSTEXPR unsigned int 01089 epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } 01090 01091 static _GLIBCXX_CONSTEXPR unsigned int 01092 round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } 01093 01094 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; 01095 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; 01096 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; 01097 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; 01098 01099 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; 01100 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; 01101 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; 01102 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm 01103 = denorm_absent; 01104 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; 01105 01106 static _GLIBCXX_CONSTEXPR unsigned int 01107 infinity() _GLIBCXX_USE_NOEXCEPT { return static_cast<unsigned int>(0); } 01108 01109 static _GLIBCXX_CONSTEXPR unsigned int 01110 quiet_NaN() _GLIBCXX_USE_NOEXCEPT 01111 { return static_cast<unsigned int>(0); } 01112 01113 static _GLIBCXX_CONSTEXPR unsigned int 01114 signaling_NaN() _GLIBCXX_USE_NOEXCEPT 01115 { return static_cast<unsigned int>(0); } 01116 01117 static _GLIBCXX_CONSTEXPR unsigned int 01118 denorm_min() _GLIBCXX_USE_NOEXCEPT 01119 { return static_cast<unsigned int>(0); } 01120 01121 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; 01122 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; 01123 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true; 01124 01125 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; 01126 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; 01127 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style 01128 = round_toward_zero; 01129 }; 01130 01131 /// numeric_limits<long> specialization. 01132 template<> 01133 struct numeric_limits<long> 01134 { 01135 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; 01136 01137 static _GLIBCXX_CONSTEXPR long 01138 min() _GLIBCXX_USE_NOEXCEPT { return -__LONG_MAX__ - 1; } 01139 01140 static _GLIBCXX_CONSTEXPR long 01141 max() _GLIBCXX_USE_NOEXCEPT { return __LONG_MAX__; } 01142 01143 #if __cplusplus >= 201103L 01144 static constexpr long 01145 lowest() noexcept { return min(); } 01146 #endif 01147 01148 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (long); 01149 static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (long); 01150 #if __cplusplus >= 201103L 01151 static constexpr int max_digits10 = 0; 01152 #endif 01153 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true; 01154 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; 01155 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; 01156 static _GLIBCXX_USE_CONSTEXPR int radix = 2; 01157 01158 static _GLIBCXX_CONSTEXPR long 01159 epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } 01160 01161 static _GLIBCXX_CONSTEXPR long 01162 round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } 01163 01164 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; 01165 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; 01166 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; 01167 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; 01168 01169 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; 01170 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; 01171 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; 01172 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm 01173 = denorm_absent; 01174 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; 01175 01176 static _GLIBCXX_CONSTEXPR long 01177 infinity() _GLIBCXX_USE_NOEXCEPT { return static_cast<long>(0); } 01178 01179 static _GLIBCXX_CONSTEXPR long 01180 quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast<long>(0); } 01181 01182 static _GLIBCXX_CONSTEXPR long 01183 signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast<long>(0); } 01184 01185 static _GLIBCXX_CONSTEXPR long 01186 denorm_min() _GLIBCXX_USE_NOEXCEPT { return static_cast<long>(0); } 01187 01188 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; 01189 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; 01190 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; 01191 01192 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; 01193 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; 01194 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style 01195 = round_toward_zero; 01196 }; 01197 01198 /// numeric_limits<unsigned long> specialization. 01199 template<> 01200 struct numeric_limits<unsigned long> 01201 { 01202 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; 01203 01204 static _GLIBCXX_CONSTEXPR unsigned long 01205 min() _GLIBCXX_USE_NOEXCEPT { return 0; } 01206 01207 static _GLIBCXX_CONSTEXPR unsigned long 01208 max() _GLIBCXX_USE_NOEXCEPT { return __LONG_MAX__ * 2UL + 1; } 01209 01210 #if __cplusplus >= 201103L 01211 static constexpr unsigned long 01212 lowest() noexcept { return min(); } 01213 #endif 01214 01215 static _GLIBCXX_USE_CONSTEXPR int digits 01216 = __glibcxx_digits (unsigned long); 01217 static _GLIBCXX_USE_CONSTEXPR int digits10 01218 = __glibcxx_digits10 (unsigned long); 01219 #if __cplusplus >= 201103L 01220 static constexpr int max_digits10 = 0; 01221 #endif 01222 static _GLIBCXX_USE_CONSTEXPR bool is_signed = false; 01223 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; 01224 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; 01225 static _GLIBCXX_USE_CONSTEXPR int radix = 2; 01226 01227 static _GLIBCXX_CONSTEXPR unsigned long 01228 epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } 01229 01230 static _GLIBCXX_CONSTEXPR unsigned long 01231 round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } 01232 01233 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; 01234 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; 01235 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; 01236 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; 01237 01238 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; 01239 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; 01240 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; 01241 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm 01242 = denorm_absent; 01243 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; 01244 01245 static _GLIBCXX_CONSTEXPR unsigned long 01246 infinity() _GLIBCXX_USE_NOEXCEPT 01247 { return static_cast<unsigned long>(0); } 01248 01249 static _GLIBCXX_CONSTEXPR unsigned long 01250 quiet_NaN() _GLIBCXX_USE_NOEXCEPT 01251 { return static_cast<unsigned long>(0); } 01252 01253 static _GLIBCXX_CONSTEXPR unsigned long 01254 signaling_NaN() _GLIBCXX_USE_NOEXCEPT 01255 { return static_cast<unsigned long>(0); } 01256 01257 static _GLIBCXX_CONSTEXPR unsigned long 01258 denorm_min() _GLIBCXX_USE_NOEXCEPT 01259 { return static_cast<unsigned long>(0); } 01260 01261 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; 01262 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; 01263 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true; 01264 01265 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; 01266 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; 01267 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style 01268 = round_toward_zero; 01269 }; 01270 01271 /// numeric_limits<long long> specialization. 01272 template<> 01273 struct numeric_limits<long long> 01274 { 01275 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; 01276 01277 static _GLIBCXX_CONSTEXPR long long 01278 min() _GLIBCXX_USE_NOEXCEPT { return -__LONG_LONG_MAX__ - 1; } 01279 01280 static _GLIBCXX_CONSTEXPR long long 01281 max() _GLIBCXX_USE_NOEXCEPT { return __LONG_LONG_MAX__; } 01282 01283 #if __cplusplus >= 201103L 01284 static constexpr long long 01285 lowest() noexcept { return min(); } 01286 #endif 01287 01288 static _GLIBCXX_USE_CONSTEXPR int digits 01289 = __glibcxx_digits (long long); 01290 static _GLIBCXX_USE_CONSTEXPR int digits10 01291 = __glibcxx_digits10 (long long); 01292 #if __cplusplus >= 201103L 01293 static constexpr int max_digits10 = 0; 01294 #endif 01295 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true; 01296 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; 01297 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; 01298 static _GLIBCXX_USE_CONSTEXPR int radix = 2; 01299 01300 static _GLIBCXX_CONSTEXPR long long 01301 epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } 01302 01303 static _GLIBCXX_CONSTEXPR long long 01304 round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } 01305 01306 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; 01307 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; 01308 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; 01309 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; 01310 01311 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; 01312 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; 01313 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; 01314 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm 01315 = denorm_absent; 01316 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; 01317 01318 static _GLIBCXX_CONSTEXPR long long 01319 infinity() _GLIBCXX_USE_NOEXCEPT { return static_cast<long long>(0); } 01320 01321 static _GLIBCXX_CONSTEXPR long long 01322 quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast<long long>(0); } 01323 01324 static _GLIBCXX_CONSTEXPR long long 01325 signaling_NaN() _GLIBCXX_USE_NOEXCEPT 01326 { return static_cast<long long>(0); } 01327 01328 static _GLIBCXX_CONSTEXPR long long 01329 denorm_min() _GLIBCXX_USE_NOEXCEPT { return static_cast<long long>(0); } 01330 01331 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; 01332 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; 01333 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; 01334 01335 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; 01336 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; 01337 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style 01338 = round_toward_zero; 01339 }; 01340 01341 /// numeric_limits<unsigned long long> specialization. 01342 template<> 01343 struct numeric_limits<unsigned long long> 01344 { 01345 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; 01346 01347 static _GLIBCXX_CONSTEXPR unsigned long long 01348 min() _GLIBCXX_USE_NOEXCEPT { return 0; } 01349 01350 static _GLIBCXX_CONSTEXPR unsigned long long 01351 max() _GLIBCXX_USE_NOEXCEPT { return __LONG_LONG_MAX__ * 2ULL + 1; } 01352 01353 #if __cplusplus >= 201103L 01354 static constexpr unsigned long long 01355 lowest() noexcept { return min(); } 01356 #endif 01357 01358 static _GLIBCXX_USE_CONSTEXPR int digits 01359 = __glibcxx_digits (unsigned long long); 01360 static _GLIBCXX_USE_CONSTEXPR int digits10 01361 = __glibcxx_digits10 (unsigned long long); 01362 #if __cplusplus >= 201103L 01363 static constexpr int max_digits10 = 0; 01364 #endif 01365 static _GLIBCXX_USE_CONSTEXPR bool is_signed = false; 01366 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; 01367 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; 01368 static _GLIBCXX_USE_CONSTEXPR int radix = 2; 01369 01370 static _GLIBCXX_CONSTEXPR unsigned long long 01371 epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } 01372 01373 static _GLIBCXX_CONSTEXPR unsigned long long 01374 round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } 01375 01376 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; 01377 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; 01378 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; 01379 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; 01380 01381 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; 01382 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; 01383 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; 01384 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm 01385 = denorm_absent; 01386 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; 01387 01388 static _GLIBCXX_CONSTEXPR unsigned long long 01389 infinity() _GLIBCXX_USE_NOEXCEPT 01390 { return static_cast<unsigned long long>(0); } 01391 01392 static _GLIBCXX_CONSTEXPR unsigned long long 01393 quiet_NaN() _GLIBCXX_USE_NOEXCEPT 01394 { return static_cast<unsigned long long>(0); } 01395 01396 static _GLIBCXX_CONSTEXPR unsigned long long 01397 signaling_NaN() _GLIBCXX_USE_NOEXCEPT 01398 { return static_cast<unsigned long long>(0); } 01399 01400 static _GLIBCXX_CONSTEXPR unsigned long long 01401 denorm_min() _GLIBCXX_USE_NOEXCEPT 01402 { return static_cast<unsigned long long>(0); } 01403 01404 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; 01405 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; 01406 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true; 01407 01408 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; 01409 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; 01410 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style 01411 = round_toward_zero; 01412 }; 01413 01414 #if !defined(__STRICT_ANSI__) 01415 01416 #define __INT_N(TYPE, BITSIZE, EXT, UEXT) \ 01417 template<> \ 01418 struct numeric_limits<TYPE> \ 01419 { \ 01420 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; \ 01421 \ 01422 static _GLIBCXX_CONSTEXPR TYPE \ 01423 min() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_min_b (TYPE, BITSIZE); } \ 01424 \ 01425 static _GLIBCXX_CONSTEXPR TYPE \ 01426 max() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_max_b (TYPE, BITSIZE); } \ 01427 \ 01428 static _GLIBCXX_USE_CONSTEXPR int digits \ 01429 = BITSIZE - 1; \ 01430 static _GLIBCXX_USE_CONSTEXPR int digits10 \ 01431 = (BITSIZE - 1) * 643L / 2136; \ 01432 \ 01433 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true; \ 01434 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; \ 01435 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; \ 01436 static _GLIBCXX_USE_CONSTEXPR int radix = 2; \ 01437 \ 01438 static _GLIBCXX_CONSTEXPR TYPE \ 01439 epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } \ 01440 \ 01441 static _GLIBCXX_CONSTEXPR TYPE \ 01442 round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } \ 01443 \ 01444 EXT \ 01445 \ 01446 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; \ 01447 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; \ 01448 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; \ 01449 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; \ 01450 \ 01451 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; \ 01452 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; \ 01453 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; \ 01454 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm \ 01455 = denorm_absent; \ 01456 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; \ 01457 \ 01458 static _GLIBCXX_CONSTEXPR TYPE \ 01459 infinity() _GLIBCXX_USE_NOEXCEPT \ 01460 { return static_cast<TYPE>(0); } \ 01461 \ 01462 static _GLIBCXX_CONSTEXPR TYPE \ 01463 quiet_NaN() _GLIBCXX_USE_NOEXCEPT \ 01464 { return static_cast<TYPE>(0); } \ 01465 \ 01466 static _GLIBCXX_CONSTEXPR TYPE \ 01467 signaling_NaN() _GLIBCXX_USE_NOEXCEPT \ 01468 { return static_cast<TYPE>(0); } \ 01469 \ 01470 static _GLIBCXX_CONSTEXPR TYPE \ 01471 denorm_min() _GLIBCXX_USE_NOEXCEPT \ 01472 { return static_cast<TYPE>(0); } \ 01473 \ 01474 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; \ 01475 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; \ 01476 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; \ 01477 \ 01478 static _GLIBCXX_USE_CONSTEXPR bool traps \ 01479 = __glibcxx_integral_traps; \ 01480 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; \ 01481 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style \ 01482 = round_toward_zero; \ 01483 }; \ 01484 \ 01485 template<> \ 01486 struct numeric_limits<unsigned TYPE> \ 01487 { \ 01488 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; \ 01489 \ 01490 static _GLIBCXX_CONSTEXPR unsigned TYPE \ 01491 min() _GLIBCXX_USE_NOEXCEPT { return 0; } \ 01492 \ 01493 static _GLIBCXX_CONSTEXPR unsigned TYPE \ 01494 max() _GLIBCXX_USE_NOEXCEPT \ 01495 { return __glibcxx_max_b (unsigned TYPE, BITSIZE); } \ 01496 \ 01497 UEXT \ 01498 \ 01499 static _GLIBCXX_USE_CONSTEXPR int digits \ 01500 = BITSIZE; \ 01501 static _GLIBCXX_USE_CONSTEXPR int digits10 \ 01502 = BITSIZE * 643L / 2136; \ 01503 static _GLIBCXX_USE_CONSTEXPR bool is_signed = false; \ 01504 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; \ 01505 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; \ 01506 static _GLIBCXX_USE_CONSTEXPR int radix = 2; \ 01507 \ 01508 static _GLIBCXX_CONSTEXPR unsigned TYPE \ 01509 epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } \ 01510 \ 01511 static _GLIBCXX_CONSTEXPR unsigned TYPE \ 01512 round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } \ 01513 \ 01514 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; \ 01515 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; \ 01516 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; \ 01517 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; \ 01518 \ 01519 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; \ 01520 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; \ 01521 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; \ 01522 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm \ 01523 = denorm_absent; \ 01524 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; \ 01525 \ 01526 static _GLIBCXX_CONSTEXPR unsigned TYPE \ 01527 infinity() _GLIBCXX_USE_NOEXCEPT \ 01528 { return static_cast<unsigned TYPE>(0); } \ 01529 \ 01530 static _GLIBCXX_CONSTEXPR unsigned TYPE \ 01531 quiet_NaN() _GLIBCXX_USE_NOEXCEPT \ 01532 { return static_cast<unsigned TYPE>(0); } \ 01533 \ 01534 static _GLIBCXX_CONSTEXPR unsigned TYPE \ 01535 signaling_NaN() _GLIBCXX_USE_NOEXCEPT \ 01536 { return static_cast<unsigned TYPE>(0); } \ 01537 \ 01538 static _GLIBCXX_CONSTEXPR unsigned TYPE \ 01539 denorm_min() _GLIBCXX_USE_NOEXCEPT \ 01540 { return static_cast<unsigned TYPE>(0); } \ 01541 \ 01542 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; \ 01543 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; \ 01544 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true; \ 01545 \ 01546 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; \ 01547 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; \ 01548 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style \ 01549 = round_toward_zero; \ 01550 }; 01551 01552 #if __cplusplus >= 201103L 01553 01554 #define __INT_N_201103(TYPE) \ 01555 static constexpr TYPE \ 01556 lowest() noexcept { return min(); } \ 01557 static constexpr int max_digits10 = 0; 01558 01559 #define __INT_N_U201103(TYPE) \ 01560 static constexpr unsigned TYPE \ 01561 lowest() noexcept { return min(); } \ 01562 static constexpr int max_digits10 = 0; 01563 01564 #else 01565 #define __INT_N_201103(TYPE) 01566 #define __INT_N_U201103(TYPE) 01567 #endif 01568 01569 #ifdef __GLIBCXX_TYPE_INT_N_0 01570 __INT_N(__GLIBCXX_TYPE_INT_N_0, __GLIBCXX_BITSIZE_INT_N_0, 01571 __INT_N_201103 (__GLIBCXX_TYPE_INT_N_0), __INT_N_U201103 (__GLIBCXX_TYPE_INT_N_0)) 01572 #endif 01573 #ifdef __GLIBCXX_TYPE_INT_N_1 01574 __INT_N (__GLIBCXX_TYPE_INT_N_1, __GLIBCXX_BITSIZE_INT_N_1, 01575 __INT_N_201103 (__GLIBCXX_TYPE_INT_N_1), __INT_N_U201103 (__GLIBCXX_TYPE_INT_N_1)) 01576 #endif 01577 #ifdef __GLIBCXX_TYPE_INT_N_2 01578 __INT_N (__GLIBCXX_TYPE_INT_N_2, __GLIBCXX_BITSIZE_INT_N_2, 01579 __INT_N_201103 (__GLIBCXX_TYPE_INT_N_2), __INT_N_U201103 (__GLIBCXX_TYPE_INT_N_2)) 01580 #endif 01581 #ifdef __GLIBCXX_TYPE_INT_N_3 01582 __INT_N (__GLIBCXX_TYPE_INT_N_3, __GLIBCXX_BITSIZE_INT_N_3, 01583 __INT_N_201103 (__GLIBCXX_TYPE_INT_N_3), __INT_N_U201103 (__GLIBCXX_TYPE_INT_N_3)) 01584 #endif 01585 01586 #undef __INT_N 01587 #undef __INT_N_201103 01588 #undef __INT_N_U201103 01589 01590 #endif 01591 01592 /// numeric_limits<float> specialization. 01593 template<> 01594 struct numeric_limits<float> 01595 { 01596 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; 01597 01598 static _GLIBCXX_CONSTEXPR float 01599 min() _GLIBCXX_USE_NOEXCEPT { return __FLT_MIN__; } 01600 01601 static _GLIBCXX_CONSTEXPR float 01602 max() _GLIBCXX_USE_NOEXCEPT { return __FLT_MAX__; } 01603 01604 #if __cplusplus >= 201103L 01605 static constexpr float 01606 lowest() noexcept { return -__FLT_MAX__; } 01607 #endif 01608 01609 static _GLIBCXX_USE_CONSTEXPR int digits = __FLT_MANT_DIG__; 01610 static _GLIBCXX_USE_CONSTEXPR int digits10 = __FLT_DIG__; 01611 #if __cplusplus >= 201103L 01612 static constexpr int max_digits10 01613 = __glibcxx_max_digits10 (__FLT_MANT_DIG__); 01614 #endif 01615 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true; 01616 static _GLIBCXX_USE_CONSTEXPR bool is_integer = false; 01617 static _GLIBCXX_USE_CONSTEXPR bool is_exact = false; 01618 static _GLIBCXX_USE_CONSTEXPR int radix = __FLT_RADIX__; 01619 01620 static _GLIBCXX_CONSTEXPR float 01621 epsilon() _GLIBCXX_USE_NOEXCEPT { return __FLT_EPSILON__; } 01622 01623 static _GLIBCXX_CONSTEXPR float 01624 round_error() _GLIBCXX_USE_NOEXCEPT { return 0.5F; } 01625 01626 static _GLIBCXX_USE_CONSTEXPR int min_exponent = __FLT_MIN_EXP__; 01627 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = __FLT_MIN_10_EXP__; 01628 static _GLIBCXX_USE_CONSTEXPR int max_exponent = __FLT_MAX_EXP__; 01629 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = __FLT_MAX_10_EXP__; 01630 01631 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = __FLT_HAS_INFINITY__; 01632 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = __FLT_HAS_QUIET_NAN__; 01633 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = has_quiet_NaN; 01634 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm 01635 = bool(__FLT_HAS_DENORM__) ? denorm_present : denorm_absent; 01636 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss 01637 = __glibcxx_float_has_denorm_loss; 01638 01639 static _GLIBCXX_CONSTEXPR float 01640 infinity() _GLIBCXX_USE_NOEXCEPT { return __builtin_huge_valf(); } 01641 01642 static _GLIBCXX_CONSTEXPR float 01643 quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return __builtin_nanf(""); } 01644 01645 static _GLIBCXX_CONSTEXPR float 01646 signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return __builtin_nansf(""); } 01647 01648 static _GLIBCXX_CONSTEXPR float 01649 denorm_min() _GLIBCXX_USE_NOEXCEPT { return __FLT_DENORM_MIN__; } 01650 01651 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 01652 = has_infinity && has_quiet_NaN && has_denorm == denorm_present; 01653 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; 01654 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; 01655 01656 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_float_traps; 01657 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before 01658 = __glibcxx_float_tinyness_before; 01659 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style 01660 = round_to_nearest; 01661 }; 01662 01663 #undef __glibcxx_float_has_denorm_loss 01664 #undef __glibcxx_float_traps 01665 #undef __glibcxx_float_tinyness_before 01666 01667 /// numeric_limits<double> specialization. 01668 template<> 01669 struct numeric_limits<double> 01670 { 01671 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; 01672 01673 static _GLIBCXX_CONSTEXPR double 01674 min() _GLIBCXX_USE_NOEXCEPT { return __DBL_MIN__; } 01675 01676 static _GLIBCXX_CONSTEXPR double 01677 max() _GLIBCXX_USE_NOEXCEPT { return __DBL_MAX__; } 01678 01679 #if __cplusplus >= 201103L 01680 static constexpr double 01681 lowest() noexcept { return -__DBL_MAX__; } 01682 #endif 01683 01684 static _GLIBCXX_USE_CONSTEXPR int digits = __DBL_MANT_DIG__; 01685 static _GLIBCXX_USE_CONSTEXPR int digits10 = __DBL_DIG__; 01686 #if __cplusplus >= 201103L 01687 static constexpr int max_digits10 01688 = __glibcxx_max_digits10 (__DBL_MANT_DIG__); 01689 #endif 01690 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true; 01691 static _GLIBCXX_USE_CONSTEXPR bool is_integer = false; 01692 static _GLIBCXX_USE_CONSTEXPR bool is_exact = false; 01693 static _GLIBCXX_USE_CONSTEXPR int radix = __FLT_RADIX__; 01694 01695 static _GLIBCXX_CONSTEXPR double 01696 epsilon() _GLIBCXX_USE_NOEXCEPT { return __DBL_EPSILON__; } 01697 01698 static _GLIBCXX_CONSTEXPR double 01699 round_error() _GLIBCXX_USE_NOEXCEPT { return 0.5; } 01700 01701 static _GLIBCXX_USE_CONSTEXPR int min_exponent = __DBL_MIN_EXP__; 01702 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = __DBL_MIN_10_EXP__; 01703 static _GLIBCXX_USE_CONSTEXPR int max_exponent = __DBL_MAX_EXP__; 01704 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = __DBL_MAX_10_EXP__; 01705 01706 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = __DBL_HAS_INFINITY__; 01707 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = __DBL_HAS_QUIET_NAN__; 01708 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = has_quiet_NaN; 01709 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm 01710 = bool(__DBL_HAS_DENORM__) ? denorm_present : denorm_absent; 01711 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss 01712 = __glibcxx_double_has_denorm_loss; 01713 01714 static _GLIBCXX_CONSTEXPR double 01715 infinity() _GLIBCXX_USE_NOEXCEPT { return __builtin_huge_val(); } 01716 01717 static _GLIBCXX_CONSTEXPR double 01718 quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return __builtin_nan(""); } 01719 01720 static _GLIBCXX_CONSTEXPR double 01721 signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return __builtin_nans(""); } 01722 01723 static _GLIBCXX_CONSTEXPR double 01724 denorm_min() _GLIBCXX_USE_NOEXCEPT { return __DBL_DENORM_MIN__; } 01725 01726 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 01727 = has_infinity && has_quiet_NaN && has_denorm == denorm_present; 01728 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; 01729 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; 01730 01731 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_double_traps; 01732 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before 01733 = __glibcxx_double_tinyness_before; 01734 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style 01735 = round_to_nearest; 01736 }; 01737 01738 #undef __glibcxx_double_has_denorm_loss 01739 #undef __glibcxx_double_traps 01740 #undef __glibcxx_double_tinyness_before 01741 01742 /// numeric_limits<long double> specialization. 01743 template<> 01744 struct numeric_limits<long double> 01745 { 01746 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; 01747 01748 static _GLIBCXX_CONSTEXPR long double 01749 min() _GLIBCXX_USE_NOEXCEPT { return __LDBL_MIN__; } 01750 01751 static _GLIBCXX_CONSTEXPR long double 01752 max() _GLIBCXX_USE_NOEXCEPT { return __LDBL_MAX__; } 01753 01754 #if __cplusplus >= 201103L 01755 static constexpr long double 01756 lowest() noexcept { return -__LDBL_MAX__; } 01757 #endif 01758 01759 static _GLIBCXX_USE_CONSTEXPR int digits = __LDBL_MANT_DIG__; 01760 static _GLIBCXX_USE_CONSTEXPR int digits10 = __LDBL_DIG__; 01761 #if __cplusplus >= 201103L 01762 static _GLIBCXX_USE_CONSTEXPR int max_digits10 01763 = __glibcxx_max_digits10 (__LDBL_MANT_DIG__); 01764 #endif 01765 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true; 01766 static _GLIBCXX_USE_CONSTEXPR bool is_integer = false; 01767 static _GLIBCXX_USE_CONSTEXPR bool is_exact = false; 01768 static _GLIBCXX_USE_CONSTEXPR int radix = __FLT_RADIX__; 01769 01770 static _GLIBCXX_CONSTEXPR long double 01771 epsilon() _GLIBCXX_USE_NOEXCEPT { return __LDBL_EPSILON__; } 01772 01773 static _GLIBCXX_CONSTEXPR long double 01774 round_error() _GLIBCXX_USE_NOEXCEPT { return 0.5L; } 01775 01776 static _GLIBCXX_USE_CONSTEXPR int min_exponent = __LDBL_MIN_EXP__; 01777 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = __LDBL_MIN_10_EXP__; 01778 static _GLIBCXX_USE_CONSTEXPR int max_exponent = __LDBL_MAX_EXP__; 01779 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = __LDBL_MAX_10_EXP__; 01780 01781 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = __LDBL_HAS_INFINITY__; 01782 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = __LDBL_HAS_QUIET_NAN__; 01783 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = has_quiet_NaN; 01784 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm 01785 = bool(__LDBL_HAS_DENORM__) ? denorm_present : denorm_absent; 01786 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss 01787 = __glibcxx_long_double_has_denorm_loss; 01788 01789 static _GLIBCXX_CONSTEXPR long double 01790 infinity() _GLIBCXX_USE_NOEXCEPT { return __builtin_huge_vall(); } 01791 01792 static _GLIBCXX_CONSTEXPR long double 01793 quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return __builtin_nanl(""); } 01794 01795 static _GLIBCXX_CONSTEXPR long double 01796 signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return __builtin_nansl(""); } 01797 01798 static _GLIBCXX_CONSTEXPR long double 01799 denorm_min() _GLIBCXX_USE_NOEXCEPT { return __LDBL_DENORM_MIN__; } 01800 01801 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 01802 = has_infinity && has_quiet_NaN && has_denorm == denorm_present; 01803 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; 01804 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; 01805 01806 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_long_double_traps; 01807 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = 01808 __glibcxx_long_double_tinyness_before; 01809 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style = 01810 round_to_nearest; 01811 }; 01812 01813 #undef __glibcxx_long_double_has_denorm_loss 01814 #undef __glibcxx_long_double_traps 01815 #undef __glibcxx_long_double_tinyness_before 01816 01817 _GLIBCXX_END_NAMESPACE_VERSION 01818 } // namespace 01819 01820 #undef __glibcxx_signed 01821 #undef __glibcxx_min 01822 #undef __glibcxx_max 01823 #undef __glibcxx_digits 01824 #undef __glibcxx_digits10 01825 #undef __glibcxx_max_digits10 01826 01827 #endif // _GLIBCXX_NUMERIC_LIMITS