libstdc++
|
00001 // The template and inlines for the numeric_limits classes. -*- C++ -*- 00002 00003 // Copyright (C) 1999-2019 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 // (+1 if char8_t is enabled.) 00378 00379 // _GLIBCXX_RESOLVE_LIB_DEFECTS 00380 // 184. numeric_limits<bool> wording problems 00381 00382 /// numeric_limits<bool> specialization. 00383 template<> 00384 struct numeric_limits<bool> 00385 { 00386 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; 00387 00388 static _GLIBCXX_CONSTEXPR bool 00389 min() _GLIBCXX_USE_NOEXCEPT { return false; } 00390 00391 static _GLIBCXX_CONSTEXPR bool 00392 max() _GLIBCXX_USE_NOEXCEPT { return true; } 00393 00394 #if __cplusplus >= 201103L 00395 static constexpr bool 00396 lowest() noexcept { return min(); } 00397 #endif 00398 static _GLIBCXX_USE_CONSTEXPR int digits = 1; 00399 static _GLIBCXX_USE_CONSTEXPR int digits10 = 0; 00400 #if __cplusplus >= 201103L 00401 static constexpr int max_digits10 = 0; 00402 #endif 00403 static _GLIBCXX_USE_CONSTEXPR bool is_signed = false; 00404 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; 00405 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; 00406 static _GLIBCXX_USE_CONSTEXPR int radix = 2; 00407 00408 static _GLIBCXX_CONSTEXPR bool 00409 epsilon() _GLIBCXX_USE_NOEXCEPT { return false; } 00410 00411 static _GLIBCXX_CONSTEXPR bool 00412 round_error() _GLIBCXX_USE_NOEXCEPT { return false; } 00413 00414 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; 00415 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; 00416 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; 00417 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; 00418 00419 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; 00420 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; 00421 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; 00422 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm 00423 = denorm_absent; 00424 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; 00425 00426 static _GLIBCXX_CONSTEXPR bool 00427 infinity() _GLIBCXX_USE_NOEXCEPT { return false; } 00428 00429 static _GLIBCXX_CONSTEXPR bool 00430 quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return false; } 00431 00432 static _GLIBCXX_CONSTEXPR bool 00433 signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return false; } 00434 00435 static _GLIBCXX_CONSTEXPR bool 00436 denorm_min() _GLIBCXX_USE_NOEXCEPT { return false; } 00437 00438 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; 00439 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; 00440 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; 00441 00442 // It is not clear what it means for a boolean type to trap. 00443 // This is a DR on the LWG issue list. Here, I use integer 00444 // promotion semantics. 00445 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; 00446 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; 00447 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style 00448 = round_toward_zero; 00449 }; 00450 00451 /// numeric_limits<char> specialization. 00452 template<> 00453 struct numeric_limits<char> 00454 { 00455 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; 00456 00457 static _GLIBCXX_CONSTEXPR char 00458 min() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_min(char); } 00459 00460 static _GLIBCXX_CONSTEXPR char 00461 max() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_max(char); } 00462 00463 #if __cplusplus >= 201103L 00464 static constexpr char 00465 lowest() noexcept { return min(); } 00466 #endif 00467 00468 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (char); 00469 static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (char); 00470 #if __cplusplus >= 201103L 00471 static constexpr int max_digits10 = 0; 00472 #endif 00473 static _GLIBCXX_USE_CONSTEXPR bool is_signed = __glibcxx_signed (char); 00474 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; 00475 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; 00476 static _GLIBCXX_USE_CONSTEXPR int radix = 2; 00477 00478 static _GLIBCXX_CONSTEXPR char 00479 epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } 00480 00481 static _GLIBCXX_CONSTEXPR char 00482 round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } 00483 00484 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; 00485 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; 00486 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; 00487 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; 00488 00489 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; 00490 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; 00491 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; 00492 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm 00493 = denorm_absent; 00494 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; 00495 00496 static _GLIBCXX_CONSTEXPR 00497 char infinity() _GLIBCXX_USE_NOEXCEPT { return char(); } 00498 00499 static _GLIBCXX_CONSTEXPR char 00500 quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return char(); } 00501 00502 static _GLIBCXX_CONSTEXPR char 00503 signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return char(); } 00504 00505 static _GLIBCXX_CONSTEXPR char 00506 denorm_min() _GLIBCXX_USE_NOEXCEPT { return static_cast<char>(0); } 00507 00508 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; 00509 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; 00510 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = !is_signed; 00511 00512 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; 00513 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; 00514 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style 00515 = round_toward_zero; 00516 }; 00517 00518 /// numeric_limits<signed char> specialization. 00519 template<> 00520 struct numeric_limits<signed char> 00521 { 00522 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; 00523 00524 static _GLIBCXX_CONSTEXPR signed char 00525 min() _GLIBCXX_USE_NOEXCEPT { return -__SCHAR_MAX__ - 1; } 00526 00527 static _GLIBCXX_CONSTEXPR signed char 00528 max() _GLIBCXX_USE_NOEXCEPT { return __SCHAR_MAX__; } 00529 00530 #if __cplusplus >= 201103L 00531 static constexpr signed char 00532 lowest() noexcept { return min(); } 00533 #endif 00534 00535 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (signed char); 00536 static _GLIBCXX_USE_CONSTEXPR int digits10 00537 = __glibcxx_digits10 (signed char); 00538 #if __cplusplus >= 201103L 00539 static constexpr int max_digits10 = 0; 00540 #endif 00541 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true; 00542 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; 00543 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; 00544 static _GLIBCXX_USE_CONSTEXPR int radix = 2; 00545 00546 static _GLIBCXX_CONSTEXPR signed char 00547 epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } 00548 00549 static _GLIBCXX_CONSTEXPR signed char 00550 round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } 00551 00552 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; 00553 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; 00554 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; 00555 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; 00556 00557 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; 00558 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; 00559 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; 00560 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm 00561 = denorm_absent; 00562 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; 00563 00564 static _GLIBCXX_CONSTEXPR signed char 00565 infinity() _GLIBCXX_USE_NOEXCEPT { return static_cast<signed char>(0); } 00566 00567 static _GLIBCXX_CONSTEXPR signed char 00568 quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast<signed char>(0); } 00569 00570 static _GLIBCXX_CONSTEXPR signed char 00571 signaling_NaN() _GLIBCXX_USE_NOEXCEPT 00572 { return static_cast<signed char>(0); } 00573 00574 static _GLIBCXX_CONSTEXPR signed char 00575 denorm_min() _GLIBCXX_USE_NOEXCEPT 00576 { return static_cast<signed char>(0); } 00577 00578 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; 00579 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; 00580 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; 00581 00582 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; 00583 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; 00584 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style 00585 = round_toward_zero; 00586 }; 00587 00588 /// numeric_limits<unsigned char> specialization. 00589 template<> 00590 struct numeric_limits<unsigned char> 00591 { 00592 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; 00593 00594 static _GLIBCXX_CONSTEXPR unsigned char 00595 min() _GLIBCXX_USE_NOEXCEPT { return 0; } 00596 00597 static _GLIBCXX_CONSTEXPR unsigned char 00598 max() _GLIBCXX_USE_NOEXCEPT { return __SCHAR_MAX__ * 2U + 1; } 00599 00600 #if __cplusplus >= 201103L 00601 static constexpr unsigned char 00602 lowest() noexcept { return min(); } 00603 #endif 00604 00605 static _GLIBCXX_USE_CONSTEXPR int digits 00606 = __glibcxx_digits (unsigned char); 00607 static _GLIBCXX_USE_CONSTEXPR int digits10 00608 = __glibcxx_digits10 (unsigned char); 00609 #if __cplusplus >= 201103L 00610 static constexpr int max_digits10 = 0; 00611 #endif 00612 static _GLIBCXX_USE_CONSTEXPR bool is_signed = false; 00613 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; 00614 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; 00615 static _GLIBCXX_USE_CONSTEXPR int radix = 2; 00616 00617 static _GLIBCXX_CONSTEXPR unsigned char 00618 epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } 00619 00620 static _GLIBCXX_CONSTEXPR unsigned char 00621 round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } 00622 00623 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; 00624 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; 00625 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; 00626 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; 00627 00628 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; 00629 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; 00630 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; 00631 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm 00632 = denorm_absent; 00633 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; 00634 00635 static _GLIBCXX_CONSTEXPR unsigned char 00636 infinity() _GLIBCXX_USE_NOEXCEPT 00637 { return static_cast<unsigned char>(0); } 00638 00639 static _GLIBCXX_CONSTEXPR unsigned char 00640 quiet_NaN() _GLIBCXX_USE_NOEXCEPT 00641 { return static_cast<unsigned char>(0); } 00642 00643 static _GLIBCXX_CONSTEXPR unsigned char 00644 signaling_NaN() _GLIBCXX_USE_NOEXCEPT 00645 { return static_cast<unsigned char>(0); } 00646 00647 static _GLIBCXX_CONSTEXPR unsigned char 00648 denorm_min() _GLIBCXX_USE_NOEXCEPT 00649 { return static_cast<unsigned char>(0); } 00650 00651 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; 00652 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; 00653 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true; 00654 00655 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; 00656 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; 00657 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style 00658 = round_toward_zero; 00659 }; 00660 00661 /// numeric_limits<wchar_t> specialization. 00662 template<> 00663 struct numeric_limits<wchar_t> 00664 { 00665 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; 00666 00667 static _GLIBCXX_CONSTEXPR wchar_t 00668 min() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_min (wchar_t); } 00669 00670 static _GLIBCXX_CONSTEXPR wchar_t 00671 max() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_max (wchar_t); } 00672 00673 #if __cplusplus >= 201103L 00674 static constexpr wchar_t 00675 lowest() noexcept { return min(); } 00676 #endif 00677 00678 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (wchar_t); 00679 static _GLIBCXX_USE_CONSTEXPR int digits10 00680 = __glibcxx_digits10 (wchar_t); 00681 #if __cplusplus >= 201103L 00682 static constexpr int max_digits10 = 0; 00683 #endif 00684 static _GLIBCXX_USE_CONSTEXPR bool is_signed = __glibcxx_signed (wchar_t); 00685 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; 00686 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; 00687 static _GLIBCXX_USE_CONSTEXPR int radix = 2; 00688 00689 static _GLIBCXX_CONSTEXPR wchar_t 00690 epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } 00691 00692 static _GLIBCXX_CONSTEXPR wchar_t 00693 round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } 00694 00695 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; 00696 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; 00697 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; 00698 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; 00699 00700 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; 00701 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; 00702 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; 00703 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm 00704 = denorm_absent; 00705 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; 00706 00707 static _GLIBCXX_CONSTEXPR wchar_t 00708 infinity() _GLIBCXX_USE_NOEXCEPT { return wchar_t(); } 00709 00710 static _GLIBCXX_CONSTEXPR wchar_t 00711 quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return wchar_t(); } 00712 00713 static _GLIBCXX_CONSTEXPR wchar_t 00714 signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return wchar_t(); } 00715 00716 static _GLIBCXX_CONSTEXPR wchar_t 00717 denorm_min() _GLIBCXX_USE_NOEXCEPT { return wchar_t(); } 00718 00719 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; 00720 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; 00721 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = !is_signed; 00722 00723 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; 00724 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; 00725 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style 00726 = round_toward_zero; 00727 }; 00728 00729 #if _GLIBCXX_USE_CHAR8_T 00730 /// numeric_limits<char8_t> specialization. 00731 template<> 00732 struct numeric_limits<char8_t> 00733 { 00734 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; 00735 00736 static _GLIBCXX_CONSTEXPR char8_t 00737 min() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_min (char8_t); } 00738 00739 static _GLIBCXX_CONSTEXPR char8_t 00740 max() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_max (char8_t); } 00741 00742 static _GLIBCXX_CONSTEXPR char8_t 00743 lowest() _GLIBCXX_USE_NOEXCEPT { return min(); } 00744 00745 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (char8_t); 00746 static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (char8_t); 00747 static _GLIBCXX_USE_CONSTEXPR int max_digits10 = 0; 00748 static _GLIBCXX_USE_CONSTEXPR bool is_signed = __glibcxx_signed (char8_t); 00749 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; 00750 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; 00751 static _GLIBCXX_USE_CONSTEXPR int radix = 2; 00752 00753 static _GLIBCXX_CONSTEXPR char8_t 00754 epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } 00755 00756 static _GLIBCXX_CONSTEXPR char8_t 00757 round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } 00758 00759 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; 00760 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; 00761 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; 00762 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; 00763 00764 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; 00765 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; 00766 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; 00767 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm 00768 = denorm_absent; 00769 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; 00770 00771 static _GLIBCXX_CONSTEXPR char8_t 00772 infinity() _GLIBCXX_USE_NOEXCEPT { return char8_t(); } 00773 00774 static _GLIBCXX_CONSTEXPR char8_t 00775 quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return char8_t(); } 00776 00777 static _GLIBCXX_CONSTEXPR char8_t 00778 signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return char8_t(); } 00779 00780 static _GLIBCXX_CONSTEXPR char8_t 00781 denorm_min() _GLIBCXX_USE_NOEXCEPT { return char8_t(); } 00782 00783 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; 00784 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; 00785 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = !is_signed; 00786 00787 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; 00788 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; 00789 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style 00790 = round_toward_zero; 00791 }; 00792 #endif 00793 00794 #if __cplusplus >= 201103L 00795 /// numeric_limits<char16_t> specialization. 00796 template<> 00797 struct numeric_limits<char16_t> 00798 { 00799 static constexpr bool is_specialized = true; 00800 00801 static constexpr char16_t 00802 min() noexcept { return __glibcxx_min (char16_t); } 00803 00804 static constexpr char16_t 00805 max() noexcept { return __glibcxx_max (char16_t); } 00806 00807 static constexpr char16_t 00808 lowest() noexcept { return min(); } 00809 00810 static constexpr int digits = __glibcxx_digits (char16_t); 00811 static constexpr int digits10 = __glibcxx_digits10 (char16_t); 00812 static constexpr int max_digits10 = 0; 00813 static constexpr bool is_signed = __glibcxx_signed (char16_t); 00814 static constexpr bool is_integer = true; 00815 static constexpr bool is_exact = true; 00816 static constexpr int radix = 2; 00817 00818 static constexpr char16_t 00819 epsilon() noexcept { return 0; } 00820 00821 static constexpr char16_t 00822 round_error() noexcept { return 0; } 00823 00824 static constexpr int min_exponent = 0; 00825 static constexpr int min_exponent10 = 0; 00826 static constexpr int max_exponent = 0; 00827 static constexpr int max_exponent10 = 0; 00828 00829 static constexpr bool has_infinity = false; 00830 static constexpr bool has_quiet_NaN = false; 00831 static constexpr bool has_signaling_NaN = false; 00832 static constexpr float_denorm_style has_denorm = denorm_absent; 00833 static constexpr bool has_denorm_loss = false; 00834 00835 static constexpr char16_t 00836 infinity() noexcept { return char16_t(); } 00837 00838 static constexpr char16_t 00839 quiet_NaN() noexcept { return char16_t(); } 00840 00841 static constexpr char16_t 00842 signaling_NaN() noexcept { return char16_t(); } 00843 00844 static constexpr char16_t 00845 denorm_min() noexcept { return char16_t(); } 00846 00847 static constexpr bool is_iec559 = false; 00848 static constexpr bool is_bounded = true; 00849 static constexpr bool is_modulo = !is_signed; 00850 00851 static constexpr bool traps = __glibcxx_integral_traps; 00852 static constexpr bool tinyness_before = false; 00853 static constexpr float_round_style round_style = round_toward_zero; 00854 }; 00855 00856 /// numeric_limits<char32_t> specialization. 00857 template<> 00858 struct numeric_limits<char32_t> 00859 { 00860 static constexpr bool is_specialized = true; 00861 00862 static constexpr char32_t 00863 min() noexcept { return __glibcxx_min (char32_t); } 00864 00865 static constexpr char32_t 00866 max() noexcept { return __glibcxx_max (char32_t); } 00867 00868 static constexpr char32_t 00869 lowest() noexcept { return min(); } 00870 00871 static constexpr int digits = __glibcxx_digits (char32_t); 00872 static constexpr int digits10 = __glibcxx_digits10 (char32_t); 00873 static constexpr int max_digits10 = 0; 00874 static constexpr bool is_signed = __glibcxx_signed (char32_t); 00875 static constexpr bool is_integer = true; 00876 static constexpr bool is_exact = true; 00877 static constexpr int radix = 2; 00878 00879 static constexpr char32_t 00880 epsilon() noexcept { return 0; } 00881 00882 static constexpr char32_t 00883 round_error() noexcept { return 0; } 00884 00885 static constexpr int min_exponent = 0; 00886 static constexpr int min_exponent10 = 0; 00887 static constexpr int max_exponent = 0; 00888 static constexpr int max_exponent10 = 0; 00889 00890 static constexpr bool has_infinity = false; 00891 static constexpr bool has_quiet_NaN = false; 00892 static constexpr bool has_signaling_NaN = false; 00893 static constexpr float_denorm_style has_denorm = denorm_absent; 00894 static constexpr bool has_denorm_loss = false; 00895 00896 static constexpr char32_t 00897 infinity() noexcept { return char32_t(); } 00898 00899 static constexpr char32_t 00900 quiet_NaN() noexcept { return char32_t(); } 00901 00902 static constexpr char32_t 00903 signaling_NaN() noexcept { return char32_t(); } 00904 00905 static constexpr char32_t 00906 denorm_min() noexcept { return char32_t(); } 00907 00908 static constexpr bool is_iec559 = false; 00909 static constexpr bool is_bounded = true; 00910 static constexpr bool is_modulo = !is_signed; 00911 00912 static constexpr bool traps = __glibcxx_integral_traps; 00913 static constexpr bool tinyness_before = false; 00914 static constexpr float_round_style round_style = round_toward_zero; 00915 }; 00916 #endif 00917 00918 /// numeric_limits<short> specialization. 00919 template<> 00920 struct numeric_limits<short> 00921 { 00922 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; 00923 00924 static _GLIBCXX_CONSTEXPR short 00925 min() _GLIBCXX_USE_NOEXCEPT { return -__SHRT_MAX__ - 1; } 00926 00927 static _GLIBCXX_CONSTEXPR short 00928 max() _GLIBCXX_USE_NOEXCEPT { return __SHRT_MAX__; } 00929 00930 #if __cplusplus >= 201103L 00931 static constexpr short 00932 lowest() noexcept { return min(); } 00933 #endif 00934 00935 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (short); 00936 static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (short); 00937 #if __cplusplus >= 201103L 00938 static constexpr int max_digits10 = 0; 00939 #endif 00940 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true; 00941 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; 00942 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; 00943 static _GLIBCXX_USE_CONSTEXPR int radix = 2; 00944 00945 static _GLIBCXX_CONSTEXPR short 00946 epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } 00947 00948 static _GLIBCXX_CONSTEXPR short 00949 round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } 00950 00951 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; 00952 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; 00953 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; 00954 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; 00955 00956 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; 00957 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; 00958 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; 00959 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm 00960 = denorm_absent; 00961 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; 00962 00963 static _GLIBCXX_CONSTEXPR short 00964 infinity() _GLIBCXX_USE_NOEXCEPT { return short(); } 00965 00966 static _GLIBCXX_CONSTEXPR short 00967 quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return short(); } 00968 00969 static _GLIBCXX_CONSTEXPR short 00970 signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return short(); } 00971 00972 static _GLIBCXX_CONSTEXPR short 00973 denorm_min() _GLIBCXX_USE_NOEXCEPT { return short(); } 00974 00975 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; 00976 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; 00977 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; 00978 00979 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; 00980 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; 00981 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style 00982 = round_toward_zero; 00983 }; 00984 00985 /// numeric_limits<unsigned short> specialization. 00986 template<> 00987 struct numeric_limits<unsigned short> 00988 { 00989 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; 00990 00991 static _GLIBCXX_CONSTEXPR unsigned short 00992 min() _GLIBCXX_USE_NOEXCEPT { return 0; } 00993 00994 static _GLIBCXX_CONSTEXPR unsigned short 00995 max() _GLIBCXX_USE_NOEXCEPT { return __SHRT_MAX__ * 2U + 1; } 00996 00997 #if __cplusplus >= 201103L 00998 static constexpr unsigned short 00999 lowest() noexcept { return min(); } 01000 #endif 01001 01002 static _GLIBCXX_USE_CONSTEXPR int digits 01003 = __glibcxx_digits (unsigned short); 01004 static _GLIBCXX_USE_CONSTEXPR int digits10 01005 = __glibcxx_digits10 (unsigned short); 01006 #if __cplusplus >= 201103L 01007 static constexpr int max_digits10 = 0; 01008 #endif 01009 static _GLIBCXX_USE_CONSTEXPR bool is_signed = false; 01010 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; 01011 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; 01012 static _GLIBCXX_USE_CONSTEXPR int radix = 2; 01013 01014 static _GLIBCXX_CONSTEXPR unsigned short 01015 epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } 01016 01017 static _GLIBCXX_CONSTEXPR unsigned short 01018 round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } 01019 01020 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; 01021 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; 01022 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; 01023 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; 01024 01025 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; 01026 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; 01027 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; 01028 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm 01029 = denorm_absent; 01030 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; 01031 01032 static _GLIBCXX_CONSTEXPR unsigned short 01033 infinity() _GLIBCXX_USE_NOEXCEPT 01034 { return static_cast<unsigned short>(0); } 01035 01036 static _GLIBCXX_CONSTEXPR unsigned short 01037 quiet_NaN() _GLIBCXX_USE_NOEXCEPT 01038 { return static_cast<unsigned short>(0); } 01039 01040 static _GLIBCXX_CONSTEXPR unsigned short 01041 signaling_NaN() _GLIBCXX_USE_NOEXCEPT 01042 { return static_cast<unsigned short>(0); } 01043 01044 static _GLIBCXX_CONSTEXPR unsigned short 01045 denorm_min() _GLIBCXX_USE_NOEXCEPT 01046 { return static_cast<unsigned short>(0); } 01047 01048 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; 01049 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; 01050 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true; 01051 01052 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; 01053 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; 01054 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style 01055 = round_toward_zero; 01056 }; 01057 01058 /// numeric_limits<int> specialization. 01059 template<> 01060 struct numeric_limits<int> 01061 { 01062 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; 01063 01064 static _GLIBCXX_CONSTEXPR int 01065 min() _GLIBCXX_USE_NOEXCEPT { return -__INT_MAX__ - 1; } 01066 01067 static _GLIBCXX_CONSTEXPR int 01068 max() _GLIBCXX_USE_NOEXCEPT { return __INT_MAX__; } 01069 01070 #if __cplusplus >= 201103L 01071 static constexpr int 01072 lowest() noexcept { return min(); } 01073 #endif 01074 01075 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (int); 01076 static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (int); 01077 #if __cplusplus >= 201103L 01078 static constexpr int max_digits10 = 0; 01079 #endif 01080 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true; 01081 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; 01082 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; 01083 static _GLIBCXX_USE_CONSTEXPR int radix = 2; 01084 01085 static _GLIBCXX_CONSTEXPR int 01086 epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } 01087 01088 static _GLIBCXX_CONSTEXPR int 01089 round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } 01090 01091 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; 01092 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; 01093 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; 01094 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; 01095 01096 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; 01097 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; 01098 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; 01099 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm 01100 = denorm_absent; 01101 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; 01102 01103 static _GLIBCXX_CONSTEXPR int 01104 infinity() _GLIBCXX_USE_NOEXCEPT { return static_cast<int>(0); } 01105 01106 static _GLIBCXX_CONSTEXPR int 01107 quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast<int>(0); } 01108 01109 static _GLIBCXX_CONSTEXPR int 01110 signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast<int>(0); } 01111 01112 static _GLIBCXX_CONSTEXPR int 01113 denorm_min() _GLIBCXX_USE_NOEXCEPT { return static_cast<int>(0); } 01114 01115 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; 01116 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; 01117 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; 01118 01119 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; 01120 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; 01121 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style 01122 = round_toward_zero; 01123 }; 01124 01125 /// numeric_limits<unsigned int> specialization. 01126 template<> 01127 struct numeric_limits<unsigned int> 01128 { 01129 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; 01130 01131 static _GLIBCXX_CONSTEXPR unsigned int 01132 min() _GLIBCXX_USE_NOEXCEPT { return 0; } 01133 01134 static _GLIBCXX_CONSTEXPR unsigned int 01135 max() _GLIBCXX_USE_NOEXCEPT { return __INT_MAX__ * 2U + 1; } 01136 01137 #if __cplusplus >= 201103L 01138 static constexpr unsigned int 01139 lowest() noexcept { return min(); } 01140 #endif 01141 01142 static _GLIBCXX_USE_CONSTEXPR int digits 01143 = __glibcxx_digits (unsigned int); 01144 static _GLIBCXX_USE_CONSTEXPR int digits10 01145 = __glibcxx_digits10 (unsigned int); 01146 #if __cplusplus >= 201103L 01147 static constexpr int max_digits10 = 0; 01148 #endif 01149 static _GLIBCXX_USE_CONSTEXPR bool is_signed = false; 01150 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; 01151 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; 01152 static _GLIBCXX_USE_CONSTEXPR int radix = 2; 01153 01154 static _GLIBCXX_CONSTEXPR unsigned int 01155 epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } 01156 01157 static _GLIBCXX_CONSTEXPR unsigned int 01158 round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } 01159 01160 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; 01161 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; 01162 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; 01163 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; 01164 01165 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; 01166 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; 01167 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; 01168 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm 01169 = denorm_absent; 01170 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; 01171 01172 static _GLIBCXX_CONSTEXPR unsigned int 01173 infinity() _GLIBCXX_USE_NOEXCEPT { return static_cast<unsigned int>(0); } 01174 01175 static _GLIBCXX_CONSTEXPR unsigned int 01176 quiet_NaN() _GLIBCXX_USE_NOEXCEPT 01177 { return static_cast<unsigned int>(0); } 01178 01179 static _GLIBCXX_CONSTEXPR unsigned int 01180 signaling_NaN() _GLIBCXX_USE_NOEXCEPT 01181 { return static_cast<unsigned int>(0); } 01182 01183 static _GLIBCXX_CONSTEXPR unsigned int 01184 denorm_min() _GLIBCXX_USE_NOEXCEPT 01185 { return static_cast<unsigned int>(0); } 01186 01187 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; 01188 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; 01189 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true; 01190 01191 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; 01192 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; 01193 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style 01194 = round_toward_zero; 01195 }; 01196 01197 /// numeric_limits<long> specialization. 01198 template<> 01199 struct numeric_limits<long> 01200 { 01201 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; 01202 01203 static _GLIBCXX_CONSTEXPR long 01204 min() _GLIBCXX_USE_NOEXCEPT { return -__LONG_MAX__ - 1; } 01205 01206 static _GLIBCXX_CONSTEXPR long 01207 max() _GLIBCXX_USE_NOEXCEPT { return __LONG_MAX__; } 01208 01209 #if __cplusplus >= 201103L 01210 static constexpr long 01211 lowest() noexcept { return min(); } 01212 #endif 01213 01214 static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (long); 01215 static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (long); 01216 #if __cplusplus >= 201103L 01217 static constexpr int max_digits10 = 0; 01218 #endif 01219 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true; 01220 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; 01221 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; 01222 static _GLIBCXX_USE_CONSTEXPR int radix = 2; 01223 01224 static _GLIBCXX_CONSTEXPR long 01225 epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } 01226 01227 static _GLIBCXX_CONSTEXPR long 01228 round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } 01229 01230 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; 01231 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; 01232 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; 01233 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; 01234 01235 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; 01236 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; 01237 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; 01238 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm 01239 = denorm_absent; 01240 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; 01241 01242 static _GLIBCXX_CONSTEXPR long 01243 infinity() _GLIBCXX_USE_NOEXCEPT { return static_cast<long>(0); } 01244 01245 static _GLIBCXX_CONSTEXPR long 01246 quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast<long>(0); } 01247 01248 static _GLIBCXX_CONSTEXPR long 01249 signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast<long>(0); } 01250 01251 static _GLIBCXX_CONSTEXPR long 01252 denorm_min() _GLIBCXX_USE_NOEXCEPT { return static_cast<long>(0); } 01253 01254 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; 01255 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; 01256 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; 01257 01258 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; 01259 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; 01260 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style 01261 = round_toward_zero; 01262 }; 01263 01264 /// numeric_limits<unsigned long> specialization. 01265 template<> 01266 struct numeric_limits<unsigned long> 01267 { 01268 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; 01269 01270 static _GLIBCXX_CONSTEXPR unsigned long 01271 min() _GLIBCXX_USE_NOEXCEPT { return 0; } 01272 01273 static _GLIBCXX_CONSTEXPR unsigned long 01274 max() _GLIBCXX_USE_NOEXCEPT { return __LONG_MAX__ * 2UL + 1; } 01275 01276 #if __cplusplus >= 201103L 01277 static constexpr unsigned long 01278 lowest() noexcept { return min(); } 01279 #endif 01280 01281 static _GLIBCXX_USE_CONSTEXPR int digits 01282 = __glibcxx_digits (unsigned long); 01283 static _GLIBCXX_USE_CONSTEXPR int digits10 01284 = __glibcxx_digits10 (unsigned long); 01285 #if __cplusplus >= 201103L 01286 static constexpr int max_digits10 = 0; 01287 #endif 01288 static _GLIBCXX_USE_CONSTEXPR bool is_signed = false; 01289 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; 01290 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; 01291 static _GLIBCXX_USE_CONSTEXPR int radix = 2; 01292 01293 static _GLIBCXX_CONSTEXPR unsigned long 01294 epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } 01295 01296 static _GLIBCXX_CONSTEXPR unsigned long 01297 round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } 01298 01299 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; 01300 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; 01301 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; 01302 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; 01303 01304 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; 01305 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; 01306 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; 01307 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm 01308 = denorm_absent; 01309 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; 01310 01311 static _GLIBCXX_CONSTEXPR unsigned long 01312 infinity() _GLIBCXX_USE_NOEXCEPT 01313 { return static_cast<unsigned long>(0); } 01314 01315 static _GLIBCXX_CONSTEXPR unsigned long 01316 quiet_NaN() _GLIBCXX_USE_NOEXCEPT 01317 { return static_cast<unsigned long>(0); } 01318 01319 static _GLIBCXX_CONSTEXPR unsigned long 01320 signaling_NaN() _GLIBCXX_USE_NOEXCEPT 01321 { return static_cast<unsigned long>(0); } 01322 01323 static _GLIBCXX_CONSTEXPR unsigned long 01324 denorm_min() _GLIBCXX_USE_NOEXCEPT 01325 { return static_cast<unsigned long>(0); } 01326 01327 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; 01328 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; 01329 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true; 01330 01331 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; 01332 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; 01333 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style 01334 = round_toward_zero; 01335 }; 01336 01337 /// numeric_limits<long long> specialization. 01338 template<> 01339 struct numeric_limits<long long> 01340 { 01341 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; 01342 01343 static _GLIBCXX_CONSTEXPR long long 01344 min() _GLIBCXX_USE_NOEXCEPT { return -__LONG_LONG_MAX__ - 1; } 01345 01346 static _GLIBCXX_CONSTEXPR long long 01347 max() _GLIBCXX_USE_NOEXCEPT { return __LONG_LONG_MAX__; } 01348 01349 #if __cplusplus >= 201103L 01350 static constexpr long long 01351 lowest() noexcept { return min(); } 01352 #endif 01353 01354 static _GLIBCXX_USE_CONSTEXPR int digits 01355 = __glibcxx_digits (long long); 01356 static _GLIBCXX_USE_CONSTEXPR int digits10 01357 = __glibcxx_digits10 (long long); 01358 #if __cplusplus >= 201103L 01359 static constexpr int max_digits10 = 0; 01360 #endif 01361 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true; 01362 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; 01363 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; 01364 static _GLIBCXX_USE_CONSTEXPR int radix = 2; 01365 01366 static _GLIBCXX_CONSTEXPR long long 01367 epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } 01368 01369 static _GLIBCXX_CONSTEXPR long long 01370 round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } 01371 01372 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; 01373 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; 01374 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; 01375 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; 01376 01377 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; 01378 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; 01379 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; 01380 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm 01381 = denorm_absent; 01382 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; 01383 01384 static _GLIBCXX_CONSTEXPR long long 01385 infinity() _GLIBCXX_USE_NOEXCEPT { return static_cast<long long>(0); } 01386 01387 static _GLIBCXX_CONSTEXPR long long 01388 quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast<long long>(0); } 01389 01390 static _GLIBCXX_CONSTEXPR long long 01391 signaling_NaN() _GLIBCXX_USE_NOEXCEPT 01392 { return static_cast<long long>(0); } 01393 01394 static _GLIBCXX_CONSTEXPR long long 01395 denorm_min() _GLIBCXX_USE_NOEXCEPT { return static_cast<long long>(0); } 01396 01397 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; 01398 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; 01399 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; 01400 01401 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; 01402 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; 01403 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style 01404 = round_toward_zero; 01405 }; 01406 01407 /// numeric_limits<unsigned long long> specialization. 01408 template<> 01409 struct numeric_limits<unsigned long long> 01410 { 01411 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; 01412 01413 static _GLIBCXX_CONSTEXPR unsigned long long 01414 min() _GLIBCXX_USE_NOEXCEPT { return 0; } 01415 01416 static _GLIBCXX_CONSTEXPR unsigned long long 01417 max() _GLIBCXX_USE_NOEXCEPT { return __LONG_LONG_MAX__ * 2ULL + 1; } 01418 01419 #if __cplusplus >= 201103L 01420 static constexpr unsigned long long 01421 lowest() noexcept { return min(); } 01422 #endif 01423 01424 static _GLIBCXX_USE_CONSTEXPR int digits 01425 = __glibcxx_digits (unsigned long long); 01426 static _GLIBCXX_USE_CONSTEXPR int digits10 01427 = __glibcxx_digits10 (unsigned long long); 01428 #if __cplusplus >= 201103L 01429 static constexpr int max_digits10 = 0; 01430 #endif 01431 static _GLIBCXX_USE_CONSTEXPR bool is_signed = false; 01432 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; 01433 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; 01434 static _GLIBCXX_USE_CONSTEXPR int radix = 2; 01435 01436 static _GLIBCXX_CONSTEXPR unsigned long long 01437 epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } 01438 01439 static _GLIBCXX_CONSTEXPR unsigned long long 01440 round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } 01441 01442 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; 01443 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; 01444 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; 01445 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; 01446 01447 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; 01448 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; 01449 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; 01450 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm 01451 = denorm_absent; 01452 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; 01453 01454 static _GLIBCXX_CONSTEXPR unsigned long long 01455 infinity() _GLIBCXX_USE_NOEXCEPT 01456 { return static_cast<unsigned long long>(0); } 01457 01458 static _GLIBCXX_CONSTEXPR unsigned long long 01459 quiet_NaN() _GLIBCXX_USE_NOEXCEPT 01460 { return static_cast<unsigned long long>(0); } 01461 01462 static _GLIBCXX_CONSTEXPR unsigned long long 01463 signaling_NaN() _GLIBCXX_USE_NOEXCEPT 01464 { return static_cast<unsigned long long>(0); } 01465 01466 static _GLIBCXX_CONSTEXPR unsigned long long 01467 denorm_min() _GLIBCXX_USE_NOEXCEPT 01468 { return static_cast<unsigned long long>(0); } 01469 01470 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; 01471 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; 01472 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true; 01473 01474 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; 01475 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; 01476 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style 01477 = round_toward_zero; 01478 }; 01479 01480 #if !defined(__STRICT_ANSI__) 01481 01482 #define __INT_N(TYPE, BITSIZE, EXT, UEXT) \ 01483 template<> \ 01484 struct numeric_limits<TYPE> \ 01485 { \ 01486 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; \ 01487 \ 01488 static _GLIBCXX_CONSTEXPR TYPE \ 01489 min() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_min_b (TYPE, BITSIZE); } \ 01490 \ 01491 static _GLIBCXX_CONSTEXPR TYPE \ 01492 max() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_max_b (TYPE, BITSIZE); } \ 01493 \ 01494 static _GLIBCXX_USE_CONSTEXPR int digits \ 01495 = BITSIZE - 1; \ 01496 static _GLIBCXX_USE_CONSTEXPR int digits10 \ 01497 = (BITSIZE - 1) * 643L / 2136; \ 01498 \ 01499 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true; \ 01500 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; \ 01501 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; \ 01502 static _GLIBCXX_USE_CONSTEXPR int radix = 2; \ 01503 \ 01504 static _GLIBCXX_CONSTEXPR TYPE \ 01505 epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } \ 01506 \ 01507 static _GLIBCXX_CONSTEXPR TYPE \ 01508 round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } \ 01509 \ 01510 EXT \ 01511 \ 01512 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; \ 01513 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; \ 01514 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; \ 01515 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; \ 01516 \ 01517 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; \ 01518 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; \ 01519 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; \ 01520 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm \ 01521 = denorm_absent; \ 01522 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; \ 01523 \ 01524 static _GLIBCXX_CONSTEXPR TYPE \ 01525 infinity() _GLIBCXX_USE_NOEXCEPT \ 01526 { return static_cast<TYPE>(0); } \ 01527 \ 01528 static _GLIBCXX_CONSTEXPR TYPE \ 01529 quiet_NaN() _GLIBCXX_USE_NOEXCEPT \ 01530 { return static_cast<TYPE>(0); } \ 01531 \ 01532 static _GLIBCXX_CONSTEXPR TYPE \ 01533 signaling_NaN() _GLIBCXX_USE_NOEXCEPT \ 01534 { return static_cast<TYPE>(0); } \ 01535 \ 01536 static _GLIBCXX_CONSTEXPR TYPE \ 01537 denorm_min() _GLIBCXX_USE_NOEXCEPT \ 01538 { return static_cast<TYPE>(0); } \ 01539 \ 01540 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; \ 01541 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; \ 01542 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; \ 01543 \ 01544 static _GLIBCXX_USE_CONSTEXPR bool traps \ 01545 = __glibcxx_integral_traps; \ 01546 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; \ 01547 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style \ 01548 = round_toward_zero; \ 01549 }; \ 01550 \ 01551 template<> \ 01552 struct numeric_limits<unsigned TYPE> \ 01553 { \ 01554 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; \ 01555 \ 01556 static _GLIBCXX_CONSTEXPR unsigned TYPE \ 01557 min() _GLIBCXX_USE_NOEXCEPT { return 0; } \ 01558 \ 01559 static _GLIBCXX_CONSTEXPR unsigned TYPE \ 01560 max() _GLIBCXX_USE_NOEXCEPT \ 01561 { return __glibcxx_max_b (unsigned TYPE, BITSIZE); } \ 01562 \ 01563 UEXT \ 01564 \ 01565 static _GLIBCXX_USE_CONSTEXPR int digits \ 01566 = BITSIZE; \ 01567 static _GLIBCXX_USE_CONSTEXPR int digits10 \ 01568 = BITSIZE * 643L / 2136; \ 01569 static _GLIBCXX_USE_CONSTEXPR bool is_signed = false; \ 01570 static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; \ 01571 static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; \ 01572 static _GLIBCXX_USE_CONSTEXPR int radix = 2; \ 01573 \ 01574 static _GLIBCXX_CONSTEXPR unsigned TYPE \ 01575 epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } \ 01576 \ 01577 static _GLIBCXX_CONSTEXPR unsigned TYPE \ 01578 round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } \ 01579 \ 01580 static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; \ 01581 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; \ 01582 static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; \ 01583 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; \ 01584 \ 01585 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; \ 01586 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; \ 01587 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; \ 01588 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm \ 01589 = denorm_absent; \ 01590 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; \ 01591 \ 01592 static _GLIBCXX_CONSTEXPR unsigned TYPE \ 01593 infinity() _GLIBCXX_USE_NOEXCEPT \ 01594 { return static_cast<unsigned TYPE>(0); } \ 01595 \ 01596 static _GLIBCXX_CONSTEXPR unsigned TYPE \ 01597 quiet_NaN() _GLIBCXX_USE_NOEXCEPT \ 01598 { return static_cast<unsigned TYPE>(0); } \ 01599 \ 01600 static _GLIBCXX_CONSTEXPR unsigned TYPE \ 01601 signaling_NaN() _GLIBCXX_USE_NOEXCEPT \ 01602 { return static_cast<unsigned TYPE>(0); } \ 01603 \ 01604 static _GLIBCXX_CONSTEXPR unsigned TYPE \ 01605 denorm_min() _GLIBCXX_USE_NOEXCEPT \ 01606 { return static_cast<unsigned TYPE>(0); } \ 01607 \ 01608 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; \ 01609 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; \ 01610 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true; \ 01611 \ 01612 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; \ 01613 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; \ 01614 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style \ 01615 = round_toward_zero; \ 01616 }; 01617 01618 #if __cplusplus >= 201103L 01619 01620 #define __INT_N_201103(TYPE) \ 01621 static constexpr TYPE \ 01622 lowest() noexcept { return min(); } \ 01623 static constexpr int max_digits10 = 0; 01624 01625 #define __INT_N_U201103(TYPE) \ 01626 static constexpr unsigned TYPE \ 01627 lowest() noexcept { return min(); } \ 01628 static constexpr int max_digits10 = 0; 01629 01630 #else 01631 #define __INT_N_201103(TYPE) 01632 #define __INT_N_U201103(TYPE) 01633 #endif 01634 01635 #ifdef __GLIBCXX_TYPE_INT_N_0 01636 __INT_N(__GLIBCXX_TYPE_INT_N_0, __GLIBCXX_BITSIZE_INT_N_0, 01637 __INT_N_201103 (__GLIBCXX_TYPE_INT_N_0), __INT_N_U201103 (__GLIBCXX_TYPE_INT_N_0)) 01638 #endif 01639 #ifdef __GLIBCXX_TYPE_INT_N_1 01640 __INT_N (__GLIBCXX_TYPE_INT_N_1, __GLIBCXX_BITSIZE_INT_N_1, 01641 __INT_N_201103 (__GLIBCXX_TYPE_INT_N_1), __INT_N_U201103 (__GLIBCXX_TYPE_INT_N_1)) 01642 #endif 01643 #ifdef __GLIBCXX_TYPE_INT_N_2 01644 __INT_N (__GLIBCXX_TYPE_INT_N_2, __GLIBCXX_BITSIZE_INT_N_2, 01645 __INT_N_201103 (__GLIBCXX_TYPE_INT_N_2), __INT_N_U201103 (__GLIBCXX_TYPE_INT_N_2)) 01646 #endif 01647 #ifdef __GLIBCXX_TYPE_INT_N_3 01648 __INT_N (__GLIBCXX_TYPE_INT_N_3, __GLIBCXX_BITSIZE_INT_N_3, 01649 __INT_N_201103 (__GLIBCXX_TYPE_INT_N_3), __INT_N_U201103 (__GLIBCXX_TYPE_INT_N_3)) 01650 #endif 01651 01652 #undef __INT_N 01653 #undef __INT_N_201103 01654 #undef __INT_N_U201103 01655 01656 #endif 01657 01658 /// numeric_limits<float> specialization. 01659 template<> 01660 struct numeric_limits<float> 01661 { 01662 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; 01663 01664 static _GLIBCXX_CONSTEXPR float 01665 min() _GLIBCXX_USE_NOEXCEPT { return __FLT_MIN__; } 01666 01667 static _GLIBCXX_CONSTEXPR float 01668 max() _GLIBCXX_USE_NOEXCEPT { return __FLT_MAX__; } 01669 01670 #if __cplusplus >= 201103L 01671 static constexpr float 01672 lowest() noexcept { return -__FLT_MAX__; } 01673 #endif 01674 01675 static _GLIBCXX_USE_CONSTEXPR int digits = __FLT_MANT_DIG__; 01676 static _GLIBCXX_USE_CONSTEXPR int digits10 = __FLT_DIG__; 01677 #if __cplusplus >= 201103L 01678 static constexpr int max_digits10 01679 = __glibcxx_max_digits10 (__FLT_MANT_DIG__); 01680 #endif 01681 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true; 01682 static _GLIBCXX_USE_CONSTEXPR bool is_integer = false; 01683 static _GLIBCXX_USE_CONSTEXPR bool is_exact = false; 01684 static _GLIBCXX_USE_CONSTEXPR int radix = __FLT_RADIX__; 01685 01686 static _GLIBCXX_CONSTEXPR float 01687 epsilon() _GLIBCXX_USE_NOEXCEPT { return __FLT_EPSILON__; } 01688 01689 static _GLIBCXX_CONSTEXPR float 01690 round_error() _GLIBCXX_USE_NOEXCEPT { return 0.5F; } 01691 01692 static _GLIBCXX_USE_CONSTEXPR int min_exponent = __FLT_MIN_EXP__; 01693 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = __FLT_MIN_10_EXP__; 01694 static _GLIBCXX_USE_CONSTEXPR int max_exponent = __FLT_MAX_EXP__; 01695 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = __FLT_MAX_10_EXP__; 01696 01697 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = __FLT_HAS_INFINITY__; 01698 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = __FLT_HAS_QUIET_NAN__; 01699 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = has_quiet_NaN; 01700 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm 01701 = bool(__FLT_HAS_DENORM__) ? denorm_present : denorm_absent; 01702 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss 01703 = __glibcxx_float_has_denorm_loss; 01704 01705 static _GLIBCXX_CONSTEXPR float 01706 infinity() _GLIBCXX_USE_NOEXCEPT { return __builtin_huge_valf(); } 01707 01708 static _GLIBCXX_CONSTEXPR float 01709 quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return __builtin_nanf(""); } 01710 01711 static _GLIBCXX_CONSTEXPR float 01712 signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return __builtin_nansf(""); } 01713 01714 static _GLIBCXX_CONSTEXPR float 01715 denorm_min() _GLIBCXX_USE_NOEXCEPT { return __FLT_DENORM_MIN__; } 01716 01717 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 01718 = has_infinity && has_quiet_NaN && has_denorm == denorm_present; 01719 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; 01720 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; 01721 01722 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_float_traps; 01723 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before 01724 = __glibcxx_float_tinyness_before; 01725 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style 01726 = round_to_nearest; 01727 }; 01728 01729 #undef __glibcxx_float_has_denorm_loss 01730 #undef __glibcxx_float_traps 01731 #undef __glibcxx_float_tinyness_before 01732 01733 /// numeric_limits<double> specialization. 01734 template<> 01735 struct numeric_limits<double> 01736 { 01737 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; 01738 01739 static _GLIBCXX_CONSTEXPR double 01740 min() _GLIBCXX_USE_NOEXCEPT { return __DBL_MIN__; } 01741 01742 static _GLIBCXX_CONSTEXPR double 01743 max() _GLIBCXX_USE_NOEXCEPT { return __DBL_MAX__; } 01744 01745 #if __cplusplus >= 201103L 01746 static constexpr double 01747 lowest() noexcept { return -__DBL_MAX__; } 01748 #endif 01749 01750 static _GLIBCXX_USE_CONSTEXPR int digits = __DBL_MANT_DIG__; 01751 static _GLIBCXX_USE_CONSTEXPR int digits10 = __DBL_DIG__; 01752 #if __cplusplus >= 201103L 01753 static constexpr int max_digits10 01754 = __glibcxx_max_digits10 (__DBL_MANT_DIG__); 01755 #endif 01756 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true; 01757 static _GLIBCXX_USE_CONSTEXPR bool is_integer = false; 01758 static _GLIBCXX_USE_CONSTEXPR bool is_exact = false; 01759 static _GLIBCXX_USE_CONSTEXPR int radix = __FLT_RADIX__; 01760 01761 static _GLIBCXX_CONSTEXPR double 01762 epsilon() _GLIBCXX_USE_NOEXCEPT { return __DBL_EPSILON__; } 01763 01764 static _GLIBCXX_CONSTEXPR double 01765 round_error() _GLIBCXX_USE_NOEXCEPT { return 0.5; } 01766 01767 static _GLIBCXX_USE_CONSTEXPR int min_exponent = __DBL_MIN_EXP__; 01768 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = __DBL_MIN_10_EXP__; 01769 static _GLIBCXX_USE_CONSTEXPR int max_exponent = __DBL_MAX_EXP__; 01770 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = __DBL_MAX_10_EXP__; 01771 01772 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = __DBL_HAS_INFINITY__; 01773 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = __DBL_HAS_QUIET_NAN__; 01774 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = has_quiet_NaN; 01775 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm 01776 = bool(__DBL_HAS_DENORM__) ? denorm_present : denorm_absent; 01777 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss 01778 = __glibcxx_double_has_denorm_loss; 01779 01780 static _GLIBCXX_CONSTEXPR double 01781 infinity() _GLIBCXX_USE_NOEXCEPT { return __builtin_huge_val(); } 01782 01783 static _GLIBCXX_CONSTEXPR double 01784 quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return __builtin_nan(""); } 01785 01786 static _GLIBCXX_CONSTEXPR double 01787 signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return __builtin_nans(""); } 01788 01789 static _GLIBCXX_CONSTEXPR double 01790 denorm_min() _GLIBCXX_USE_NOEXCEPT { return __DBL_DENORM_MIN__; } 01791 01792 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 01793 = has_infinity && has_quiet_NaN && has_denorm == denorm_present; 01794 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; 01795 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; 01796 01797 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_double_traps; 01798 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before 01799 = __glibcxx_double_tinyness_before; 01800 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style 01801 = round_to_nearest; 01802 }; 01803 01804 #undef __glibcxx_double_has_denorm_loss 01805 #undef __glibcxx_double_traps 01806 #undef __glibcxx_double_tinyness_before 01807 01808 /// numeric_limits<long double> specialization. 01809 template<> 01810 struct numeric_limits<long double> 01811 { 01812 static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; 01813 01814 static _GLIBCXX_CONSTEXPR long double 01815 min() _GLIBCXX_USE_NOEXCEPT { return __LDBL_MIN__; } 01816 01817 static _GLIBCXX_CONSTEXPR long double 01818 max() _GLIBCXX_USE_NOEXCEPT { return __LDBL_MAX__; } 01819 01820 #if __cplusplus >= 201103L 01821 static constexpr long double 01822 lowest() noexcept { return -__LDBL_MAX__; } 01823 #endif 01824 01825 static _GLIBCXX_USE_CONSTEXPR int digits = __LDBL_MANT_DIG__; 01826 static _GLIBCXX_USE_CONSTEXPR int digits10 = __LDBL_DIG__; 01827 #if __cplusplus >= 201103L 01828 static _GLIBCXX_USE_CONSTEXPR int max_digits10 01829 = __glibcxx_max_digits10 (__LDBL_MANT_DIG__); 01830 #endif 01831 static _GLIBCXX_USE_CONSTEXPR bool is_signed = true; 01832 static _GLIBCXX_USE_CONSTEXPR bool is_integer = false; 01833 static _GLIBCXX_USE_CONSTEXPR bool is_exact = false; 01834 static _GLIBCXX_USE_CONSTEXPR int radix = __FLT_RADIX__; 01835 01836 static _GLIBCXX_CONSTEXPR long double 01837 epsilon() _GLIBCXX_USE_NOEXCEPT { return __LDBL_EPSILON__; } 01838 01839 static _GLIBCXX_CONSTEXPR long double 01840 round_error() _GLIBCXX_USE_NOEXCEPT { return 0.5L; } 01841 01842 static _GLIBCXX_USE_CONSTEXPR int min_exponent = __LDBL_MIN_EXP__; 01843 static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = __LDBL_MIN_10_EXP__; 01844 static _GLIBCXX_USE_CONSTEXPR int max_exponent = __LDBL_MAX_EXP__; 01845 static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = __LDBL_MAX_10_EXP__; 01846 01847 static _GLIBCXX_USE_CONSTEXPR bool has_infinity = __LDBL_HAS_INFINITY__; 01848 static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = __LDBL_HAS_QUIET_NAN__; 01849 static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = has_quiet_NaN; 01850 static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm 01851 = bool(__LDBL_HAS_DENORM__) ? denorm_present : denorm_absent; 01852 static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss 01853 = __glibcxx_long_double_has_denorm_loss; 01854 01855 static _GLIBCXX_CONSTEXPR long double 01856 infinity() _GLIBCXX_USE_NOEXCEPT { return __builtin_huge_vall(); } 01857 01858 static _GLIBCXX_CONSTEXPR long double 01859 quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return __builtin_nanl(""); } 01860 01861 static _GLIBCXX_CONSTEXPR long double 01862 signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return __builtin_nansl(""); } 01863 01864 static _GLIBCXX_CONSTEXPR long double 01865 denorm_min() _GLIBCXX_USE_NOEXCEPT { return __LDBL_DENORM_MIN__; } 01866 01867 static _GLIBCXX_USE_CONSTEXPR bool is_iec559 01868 = has_infinity && has_quiet_NaN && has_denorm == denorm_present; 01869 static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; 01870 static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; 01871 01872 static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_long_double_traps; 01873 static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = 01874 __glibcxx_long_double_tinyness_before; 01875 static _GLIBCXX_USE_CONSTEXPR float_round_style round_style = 01876 round_to_nearest; 01877 }; 01878 01879 #undef __glibcxx_long_double_has_denorm_loss 01880 #undef __glibcxx_long_double_traps 01881 #undef __glibcxx_long_double_tinyness_before 01882 01883 _GLIBCXX_END_NAMESPACE_VERSION 01884 } // namespace 01885 01886 #undef __glibcxx_signed 01887 #undef __glibcxx_min 01888 #undef __glibcxx_max 01889 #undef __glibcxx_digits 01890 #undef __glibcxx_digits10 01891 #undef __glibcxx_max_digits10 01892 01893 #endif // _GLIBCXX_NUMERIC_LIMITS