Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef _GLIBCXX_NUMERIC_LIMITS
00039 #define _GLIBCXX_NUMERIC_LIMITS 1
00040
00041 #pragma GCC system_header
00042
00043 #include <bits/c++config.h>
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080 #ifndef __glibcxx_integral_traps
00081 # define __glibcxx_integral_traps true
00082 #endif
00083
00084
00085
00086
00087
00088
00089 #ifndef __glibcxx_float_has_denorm_loss
00090 # define __glibcxx_float_has_denorm_loss false
00091 #endif
00092 #ifndef __glibcxx_float_traps
00093 # define __glibcxx_float_traps false
00094 #endif
00095 #ifndef __glibcxx_float_tinyness_before
00096 # define __glibcxx_float_tinyness_before false
00097 #endif
00098
00099
00100
00101
00102
00103 #ifndef __glibcxx_double_has_denorm_loss
00104 # define __glibcxx_double_has_denorm_loss false
00105 #endif
00106 #ifndef __glibcxx_double_traps
00107 # define __glibcxx_double_traps false
00108 #endif
00109 #ifndef __glibcxx_double_tinyness_before
00110 # define __glibcxx_double_tinyness_before false
00111 #endif
00112
00113
00114
00115
00116
00117 #ifndef __glibcxx_long_double_has_denorm_loss
00118 # define __glibcxx_long_double_has_denorm_loss false
00119 #endif
00120 #ifndef __glibcxx_long_double_traps
00121 # define __glibcxx_long_double_traps false
00122 #endif
00123 #ifndef __glibcxx_long_double_tinyness_before
00124 # define __glibcxx_long_double_tinyness_before false
00125 #endif
00126
00127
00128
00129 #define __glibcxx_signed(T) ((T)(-1) < 0)
00130
00131 #define __glibcxx_min(T) \
00132 (__glibcxx_signed (T) ? (T)1 << __glibcxx_digits (T) : (T)0)
00133
00134 #define __glibcxx_max(T) \
00135 (__glibcxx_signed (T) ? \
00136 (((((T)1 << (__glibcxx_digits (T) - 1)) - 1) << 1) + 1) : ~(T)0)
00137
00138 #define __glibcxx_digits(T) \
00139 (sizeof(T) * __CHAR_BIT__ - __glibcxx_signed (T))
00140
00141
00142 #define __glibcxx_digits10(T) \
00143 (__glibcxx_digits (T) * 643 / 2136)
00144
00145 #define __glibcxx_max_digits10(T) \
00146 (2 + (T) * 643 / 2136)
00147
00148 _GLIBCXX_BEGIN_NAMESPACE(std)
00149
00150
00151
00152
00153
00154
00155 enum float_round_style
00156 {
00157 round_indeterminate = -1,
00158 round_toward_zero = 0,
00159 round_to_nearest = 1,
00160 round_toward_infinity = 2,
00161 round_toward_neg_infinity = 3
00162 };
00163
00164
00165
00166
00167
00168
00169
00170 enum float_denorm_style
00171 {
00172
00173 denorm_indeterminate = -1,
00174
00175 denorm_absent = 0,
00176
00177 denorm_present = 1
00178 };
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190 struct __numeric_limits_base
00191 {
00192
00193
00194 static const bool is_specialized = false;
00195
00196
00197
00198
00199 static const int digits = 0;
00200
00201 static const int digits10 = 0;
00202 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00203
00204
00205 static const int max_digits10 = 0;
00206 #endif
00207
00208 static const bool is_signed = false;
00209
00210
00211 static const bool is_integer = false;
00212
00213
00214
00215
00216 static const bool is_exact = false;
00217
00218
00219 static const int radix = 0;
00220
00221
00222
00223 static const int min_exponent = 0;
00224
00225
00226 static const int min_exponent10 = 0;
00227
00228
00229
00230 static const int max_exponent = 0;
00231
00232
00233 static const int max_exponent10 = 0;
00234
00235
00236 static const bool has_infinity = false;
00237
00238
00239 static const bool has_quiet_NaN = false;
00240
00241
00242 static const bool has_signaling_NaN = false;
00243
00244 static const float_denorm_style has_denorm = denorm_absent;
00245
00246
00247 static const bool has_denorm_loss = false;
00248
00249
00250
00251 static const bool is_iec559 = false;
00252
00253
00254
00255 static const bool is_bounded = false;
00256
00257
00258
00259
00260 static const bool is_modulo = false;
00261
00262
00263 static const bool traps = false;
00264
00265 static const bool tinyness_before = false;
00266
00267
00268
00269 static const float_round_style round_style = round_toward_zero;
00270 };
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283 template<typename _Tp>
00284 struct numeric_limits : public __numeric_limits_base
00285 {
00286
00287
00288 static _Tp min() throw() { return static_cast<_Tp>(0); }
00289
00290 static _Tp max() throw() { return static_cast<_Tp>(0); }
00291 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00292
00293
00294 static _Tp lowest() throw() { return static_cast<_Tp>(0); }
00295 #endif
00296
00297
00298 static _Tp epsilon() throw() { return static_cast<_Tp>(0); }
00299
00300 static _Tp round_error() throw() { return static_cast<_Tp>(0); }
00301
00302 static _Tp infinity() throw() { return static_cast<_Tp>(0); }
00303
00304
00305
00306 static _Tp quiet_NaN() throw() { return static_cast<_Tp>(0); }
00307
00308
00309 static _Tp signaling_NaN() throw() { return static_cast<_Tp>(0); }
00310
00311
00312
00313 static _Tp denorm_min() throw() { return static_cast<_Tp>(0); }
00314 };
00315
00316 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00317 template<typename _Tp>
00318 struct numeric_limits<const _Tp>
00319 : public numeric_limits<_Tp> { };
00320
00321 template<typename _Tp>
00322 struct numeric_limits<volatile _Tp>
00323 : public numeric_limits<_Tp> { };
00324
00325 template<typename _Tp>
00326 struct numeric_limits<const volatile _Tp>
00327 : public numeric_limits<_Tp> { };
00328 #endif
00329
00330
00331
00332
00333
00334 template<>
00335 struct numeric_limits<bool>
00336 {
00337 static const bool is_specialized = true;
00338
00339 static bool min() throw()
00340 { return false; }
00341 static bool max() throw()
00342 { return true; }
00343 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00344 static bool lowest() throw()
00345 { return min(); }
00346 #endif
00347 static const int digits = 1;
00348 static const int digits10 = 0;
00349 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00350 static const int max_digits10 = 0;
00351 #endif
00352 static const bool is_signed = false;
00353 static const bool is_integer = true;
00354 static const bool is_exact = true;
00355 static const int radix = 2;
00356 static bool epsilon() throw()
00357 { return false; }
00358 static bool round_error() throw()
00359 { return false; }
00360
00361 static const int min_exponent = 0;
00362 static const int min_exponent10 = 0;
00363 static const int max_exponent = 0;
00364 static const int max_exponent10 = 0;
00365
00366 static const bool has_infinity = false;
00367 static const bool has_quiet_NaN = false;
00368 static const bool has_signaling_NaN = false;
00369 static const float_denorm_style has_denorm = denorm_absent;
00370 static const bool has_denorm_loss = false;
00371
00372 static bool infinity() throw()
00373 { return false; }
00374 static bool quiet_NaN() throw()
00375 { return false; }
00376 static bool signaling_NaN() throw()
00377 { return false; }
00378 static bool denorm_min() throw()
00379 { return false; }
00380
00381 static const bool is_iec559 = false;
00382 static const bool is_bounded = true;
00383 static const bool is_modulo = false;
00384
00385
00386
00387
00388 static const bool traps = __glibcxx_integral_traps;
00389 static const bool tinyness_before = false;
00390 static const float_round_style round_style = round_toward_zero;
00391 };
00392
00393
00394 template<>
00395 struct numeric_limits<char>
00396 {
00397 static const bool is_specialized = true;
00398
00399 static char min() throw()
00400 { return __glibcxx_min(char); }
00401 static char max() throw()
00402 { return __glibcxx_max(char); }
00403 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00404 static char lowest() throw()
00405 { return min(); }
00406 #endif
00407
00408 static const int digits = __glibcxx_digits (char);
00409 static const int digits10 = __glibcxx_digits10 (char);
00410 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00411 static const int max_digits10 = 0;
00412 #endif
00413 static const bool is_signed = __glibcxx_signed (char);
00414 static const bool is_integer = true;
00415 static const bool is_exact = true;
00416 static const int radix = 2;
00417 static char epsilon() throw()
00418 { return 0; }
00419 static char round_error() throw()
00420 { return 0; }
00421
00422 static const int min_exponent = 0;
00423 static const int min_exponent10 = 0;
00424 static const int max_exponent = 0;
00425 static const int max_exponent10 = 0;
00426
00427 static const bool has_infinity = false;
00428 static const bool has_quiet_NaN = false;
00429 static const bool has_signaling_NaN = false;
00430 static const float_denorm_style has_denorm = denorm_absent;
00431 static const bool has_denorm_loss = false;
00432
00433 static char infinity() throw()
00434 { return char(); }
00435 static char quiet_NaN() throw()
00436 { return char(); }
00437 static char signaling_NaN() throw()
00438 { return char(); }
00439 static char denorm_min() throw()
00440 { return static_cast<char>(0); }
00441
00442 static const bool is_iec559 = false;
00443 static const bool is_bounded = true;
00444 static const bool is_modulo = true;
00445
00446 static const bool traps = __glibcxx_integral_traps;
00447 static const bool tinyness_before = false;
00448 static const float_round_style round_style = round_toward_zero;
00449 };
00450
00451
00452 template<>
00453 struct numeric_limits<signed char>
00454 {
00455 static const bool is_specialized = true;
00456
00457 static signed char min() throw()
00458 { return -__SCHAR_MAX__ - 1; }
00459 static signed char max() throw()
00460 { return __SCHAR_MAX__; }
00461 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00462 static signed char lowest() throw()
00463 { return min(); }
00464 #endif
00465
00466 static const int digits = __glibcxx_digits (signed char);
00467 static const int digits10 = __glibcxx_digits10 (signed char);
00468 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00469 static const int max_digits10 = 0;
00470 #endif
00471 static const bool is_signed = true;
00472 static const bool is_integer = true;
00473 static const bool is_exact = true;
00474 static const int radix = 2;
00475 static signed char epsilon() throw()
00476 { return 0; }
00477 static signed char round_error() throw()
00478 { return 0; }
00479
00480 static const int min_exponent = 0;
00481 static const int min_exponent10 = 0;
00482 static const int max_exponent = 0;
00483 static const int max_exponent10 = 0;
00484
00485 static const bool has_infinity = false;
00486 static const bool has_quiet_NaN = false;
00487 static const bool has_signaling_NaN = false;
00488 static const float_denorm_style has_denorm = denorm_absent;
00489 static const bool has_denorm_loss = false;
00490
00491 static signed char infinity() throw()
00492 { return static_cast<signed char>(0); }
00493 static signed char quiet_NaN() throw()
00494 { return static_cast<signed char>(0); }
00495 static signed char signaling_NaN() throw()
00496 { return static_cast<signed char>(0); }
00497 static signed char denorm_min() throw()
00498 { return static_cast<signed char>(0); }
00499
00500 static const bool is_iec559 = false;
00501 static const bool is_bounded = true;
00502 static const bool is_modulo = true;
00503
00504 static const bool traps = __glibcxx_integral_traps;
00505 static const bool tinyness_before = false;
00506 static const float_round_style round_style = round_toward_zero;
00507 };
00508
00509
00510 template<>
00511 struct numeric_limits<unsigned char>
00512 {
00513 static const bool is_specialized = true;
00514
00515 static unsigned char min() throw()
00516 { return 0; }
00517 static unsigned char max() throw()
00518 { return __SCHAR_MAX__ * 2U + 1; }
00519 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00520 static unsigned char lowest() throw()
00521 { return min(); }
00522 #endif
00523
00524 static const int digits = __glibcxx_digits (unsigned char);
00525 static const int digits10 = __glibcxx_digits10 (unsigned char);
00526 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00527 static const int max_digits10 = 0;
00528 #endif
00529 static const bool is_signed = false;
00530 static const bool is_integer = true;
00531 static const bool is_exact = true;
00532 static const int radix = 2;
00533 static unsigned char epsilon() throw()
00534 { return 0; }
00535 static unsigned char round_error() throw()
00536 { return 0; }
00537
00538 static const int min_exponent = 0;
00539 static const int min_exponent10 = 0;
00540 static const int max_exponent = 0;
00541 static const int max_exponent10 = 0;
00542
00543 static const bool has_infinity = false;
00544 static const bool has_quiet_NaN = false;
00545 static const bool has_signaling_NaN = false;
00546 static const float_denorm_style has_denorm = denorm_absent;
00547 static const bool has_denorm_loss = false;
00548
00549 static unsigned char infinity() throw()
00550 { return static_cast<unsigned char>(0); }
00551 static unsigned char quiet_NaN() throw()
00552 { return static_cast<unsigned char>(0); }
00553 static unsigned char signaling_NaN() throw()
00554 { return static_cast<unsigned char>(0); }
00555 static unsigned char denorm_min() throw()
00556 { return static_cast<unsigned char>(0); }
00557
00558 static const bool is_iec559 = false;
00559 static const bool is_bounded = true;
00560 static const bool is_modulo = true;
00561
00562 static const bool traps = __glibcxx_integral_traps;
00563 static const bool tinyness_before = false;
00564 static const float_round_style round_style = round_toward_zero;
00565 };
00566
00567
00568 template<>
00569 struct numeric_limits<wchar_t>
00570 {
00571 static const bool is_specialized = true;
00572
00573 static wchar_t min() throw()
00574 { return __glibcxx_min (wchar_t); }
00575 static wchar_t max() throw()
00576 { return __glibcxx_max (wchar_t); }
00577 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00578 static wchar_t lowest() throw()
00579 { return min(); }
00580 #endif
00581
00582 static const int digits = __glibcxx_digits (wchar_t);
00583 static const int digits10 = __glibcxx_digits10 (wchar_t);
00584 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00585 static const int max_digits10 = 0;
00586 #endif
00587 static const bool is_signed = __glibcxx_signed (wchar_t);
00588 static const bool is_integer = true;
00589 static const bool is_exact = true;
00590 static const int radix = 2;
00591 static wchar_t epsilon() throw()
00592 { return 0; }
00593 static wchar_t round_error() throw()
00594 { return 0; }
00595
00596 static const int min_exponent = 0;
00597 static const int min_exponent10 = 0;
00598 static const int max_exponent = 0;
00599 static const int max_exponent10 = 0;
00600
00601 static const bool has_infinity = false;
00602 static const bool has_quiet_NaN = false;
00603 static const bool has_signaling_NaN = false;
00604 static const float_denorm_style has_denorm = denorm_absent;
00605 static const bool has_denorm_loss = false;
00606
00607 static wchar_t infinity() throw()
00608 { return wchar_t(); }
00609 static wchar_t quiet_NaN() throw()
00610 { return wchar_t(); }
00611 static wchar_t signaling_NaN() throw()
00612 { return wchar_t(); }
00613 static wchar_t denorm_min() throw()
00614 { return wchar_t(); }
00615
00616 static const bool is_iec559 = false;
00617 static const bool is_bounded = true;
00618 static const bool is_modulo = true;
00619
00620 static const bool traps = __glibcxx_integral_traps;
00621 static const bool tinyness_before = false;
00622 static const float_round_style round_style = round_toward_zero;
00623 };
00624
00625 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00626
00627 template<>
00628 struct numeric_limits<char16_t>
00629 {
00630 static const bool is_specialized = true;
00631
00632 static char16_t min() throw()
00633 { return __glibcxx_min (char16_t); }
00634 static char16_t max() throw()
00635 { return __glibcxx_max (char16_t); }
00636 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00637 static char16_t lowest() throw()
00638 { return min(); }
00639 #endif
00640
00641 static const int digits = __glibcxx_digits (char16_t);
00642 static const int digits10 = __glibcxx_digits10 (char16_t);
00643 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00644 static const int max_digits10 = 0;
00645 #endif
00646 static const bool is_signed = __glibcxx_signed (char16_t);
00647 static const bool is_integer = true;
00648 static const bool is_exact = true;
00649 static const int radix = 2;
00650 static char16_t epsilon() throw()
00651 { return 0; }
00652 static char16_t round_error() throw()
00653 { return 0; }
00654
00655 static const int min_exponent = 0;
00656 static const int min_exponent10 = 0;
00657 static const int max_exponent = 0;
00658 static const int max_exponent10 = 0;
00659
00660 static const bool has_infinity = false;
00661 static const bool has_quiet_NaN = false;
00662 static const bool has_signaling_NaN = false;
00663 static const float_denorm_style has_denorm = denorm_absent;
00664 static const bool has_denorm_loss = false;
00665
00666 static char16_t infinity() throw()
00667 { return char16_t(); }
00668 static char16_t quiet_NaN() throw()
00669 { return char16_t(); }
00670 static char16_t signaling_NaN() throw()
00671 { return char16_t(); }
00672 static char16_t denorm_min() throw()
00673 { return char16_t(); }
00674
00675 static const bool is_iec559 = false;
00676 static const bool is_bounded = true;
00677 static const bool is_modulo = true;
00678
00679 static const bool traps = __glibcxx_integral_traps;
00680 static const bool tinyness_before = false;
00681 static const float_round_style round_style = round_toward_zero;
00682 };
00683
00684
00685 template<>
00686 struct numeric_limits<char32_t>
00687 {
00688 static const bool is_specialized = true;
00689
00690 static char32_t min() throw()
00691 { return __glibcxx_min (char32_t); }
00692 static char32_t max() throw()
00693 { return __glibcxx_max (char32_t); }
00694 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00695 static char32_t lowest() throw()
00696 { return min(); }
00697 #endif
00698
00699 static const int digits = __glibcxx_digits (char32_t);
00700 static const int digits10 = __glibcxx_digits10 (char32_t);
00701 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00702 static const int max_digits10 = 0;
00703 #endif
00704 static const bool is_signed = __glibcxx_signed (char32_t);
00705 static const bool is_integer = true;
00706 static const bool is_exact = true;
00707 static const int radix = 2;
00708 static char32_t epsilon() throw()
00709 { return 0; }
00710 static char32_t round_error() throw()
00711 { return 0; }
00712
00713 static const int min_exponent = 0;
00714 static const int min_exponent10 = 0;
00715 static const int max_exponent = 0;
00716 static const int max_exponent10 = 0;
00717
00718 static const bool has_infinity = false;
00719 static const bool has_quiet_NaN = false;
00720 static const bool has_signaling_NaN = false;
00721 static const float_denorm_style has_denorm = denorm_absent;
00722 static const bool has_denorm_loss = false;
00723
00724 static char32_t infinity() throw()
00725 { return char32_t(); }
00726 static char32_t quiet_NaN() throw()
00727 { return char32_t(); }
00728 static char32_t signaling_NaN() throw()
00729 { return char32_t(); }
00730 static char32_t denorm_min() throw()
00731 { return char32_t(); }
00732
00733 static const bool is_iec559 = false;
00734 static const bool is_bounded = true;
00735 static const bool is_modulo = true;
00736
00737 static const bool traps = __glibcxx_integral_traps;
00738 static const bool tinyness_before = false;
00739 static const float_round_style round_style = round_toward_zero;
00740 };
00741 #endif
00742
00743
00744 template<>
00745 struct numeric_limits<short>
00746 {
00747 static const bool is_specialized = true;
00748
00749 static short min() throw()
00750 { return -__SHRT_MAX__ - 1; }
00751 static short max() throw()
00752 { return __SHRT_MAX__; }
00753 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00754 static short lowest() throw()
00755 { return min(); }
00756 #endif
00757
00758 static const int digits = __glibcxx_digits (short);
00759 static const int digits10 = __glibcxx_digits10 (short);
00760 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00761 static const int max_digits10 = 0;
00762 #endif
00763 static const bool is_signed = true;
00764 static const bool is_integer = true;
00765 static const bool is_exact = true;
00766 static const int radix = 2;
00767 static short epsilon() throw()
00768 { return 0; }
00769 static short round_error() throw()
00770 { return 0; }
00771
00772 static const int min_exponent = 0;
00773 static const int min_exponent10 = 0;
00774 static const int max_exponent = 0;
00775 static const int max_exponent10 = 0;
00776
00777 static const bool has_infinity = false;
00778 static const bool has_quiet_NaN = false;
00779 static const bool has_signaling_NaN = false;
00780 static const float_denorm_style has_denorm = denorm_absent;
00781 static const bool has_denorm_loss = false;
00782
00783 static short infinity() throw()
00784 { return short(); }
00785 static short quiet_NaN() throw()
00786 { return short(); }
00787 static short signaling_NaN() throw()
00788 { return short(); }
00789 static short denorm_min() throw()
00790 { return short(); }
00791
00792 static const bool is_iec559 = false;
00793 static const bool is_bounded = true;
00794 static const bool is_modulo = true;
00795
00796 static const bool traps = __glibcxx_integral_traps;
00797 static const bool tinyness_before = false;
00798 static const float_round_style round_style = round_toward_zero;
00799 };
00800
00801
00802 template<>
00803 struct numeric_limits<unsigned short>
00804 {
00805 static const bool is_specialized = true;
00806
00807 static unsigned short min() throw()
00808 { return 0; }
00809 static unsigned short max() throw()
00810 { return __SHRT_MAX__ * 2U + 1; }
00811 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00812 static unsigned short lowest() throw()
00813 { return min(); }
00814 #endif
00815
00816 static const int digits = __glibcxx_digits (unsigned short);
00817 static const int digits10 = __glibcxx_digits10 (unsigned short);
00818 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00819 static const int max_digits10 = 0;
00820 #endif
00821 static const bool is_signed = false;
00822 static const bool is_integer = true;
00823 static const bool is_exact = true;
00824 static const int radix = 2;
00825 static unsigned short epsilon() throw()
00826 { return 0; }
00827 static unsigned short round_error() throw()
00828 { return 0; }
00829
00830 static const int min_exponent = 0;
00831 static const int min_exponent10 = 0;
00832 static const int max_exponent = 0;
00833 static const int max_exponent10 = 0;
00834
00835 static const bool has_infinity = false;
00836 static const bool has_quiet_NaN = false;
00837 static const bool has_signaling_NaN = false;
00838 static const float_denorm_style has_denorm = denorm_absent;
00839 static const bool has_denorm_loss = false;
00840
00841 static unsigned short infinity() throw()
00842 { return static_cast<unsigned short>(0); }
00843 static unsigned short quiet_NaN() throw()
00844 { return static_cast<unsigned short>(0); }
00845 static unsigned short signaling_NaN() throw()
00846 { return static_cast<unsigned short>(0); }
00847 static unsigned short denorm_min() throw()
00848 { return static_cast<unsigned short>(0); }
00849
00850 static const bool is_iec559 = false;
00851 static const bool is_bounded = true;
00852 static const bool is_modulo = true;
00853
00854 static const bool traps = __glibcxx_integral_traps;
00855 static const bool tinyness_before = false;
00856 static const float_round_style round_style = round_toward_zero;
00857 };
00858
00859
00860 template<>
00861 struct numeric_limits<int>
00862 {
00863 static const bool is_specialized = true;
00864
00865 static int min() throw()
00866 { return -__INT_MAX__ - 1; }
00867 static int max() throw()
00868 { return __INT_MAX__; }
00869 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00870 static int lowest() throw()
00871 { return min(); }
00872 #endif
00873
00874 static const int digits = __glibcxx_digits (int);
00875 static const int digits10 = __glibcxx_digits10 (int);
00876 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00877 static const int max_digits10 = 0;
00878 #endif
00879 static const bool is_signed = true;
00880 static const bool is_integer = true;
00881 static const bool is_exact = true;
00882 static const int radix = 2;
00883 static int epsilon() throw()
00884 { return 0; }
00885 static int round_error() throw()
00886 { return 0; }
00887
00888 static const int min_exponent = 0;
00889 static const int min_exponent10 = 0;
00890 static const int max_exponent = 0;
00891 static const int max_exponent10 = 0;
00892
00893 static const bool has_infinity = false;
00894 static const bool has_quiet_NaN = false;
00895 static const bool has_signaling_NaN = false;
00896 static const float_denorm_style has_denorm = denorm_absent;
00897 static const bool has_denorm_loss = false;
00898
00899 static int infinity() throw()
00900 { return static_cast<int>(0); }
00901 static int quiet_NaN() throw()
00902 { return static_cast<int>(0); }
00903 static int signaling_NaN() throw()
00904 { return static_cast<int>(0); }
00905 static int denorm_min() throw()
00906 { return static_cast<int>(0); }
00907
00908 static const bool is_iec559 = false;
00909 static const bool is_bounded = true;
00910 static const bool is_modulo = true;
00911
00912 static const bool traps = __glibcxx_integral_traps;
00913 static const bool tinyness_before = false;
00914 static const float_round_style round_style = round_toward_zero;
00915 };
00916
00917
00918 template<>
00919 struct numeric_limits<unsigned int>
00920 {
00921 static const bool is_specialized = true;
00922
00923 static unsigned int min() throw()
00924 { return 0; }
00925 static unsigned int max() throw()
00926 { return __INT_MAX__ * 2U + 1; }
00927 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00928 static unsigned int lowest() throw()
00929 { return min(); }
00930 #endif
00931
00932 static const int digits = __glibcxx_digits (unsigned int);
00933 static const int digits10 = __glibcxx_digits10 (unsigned int);
00934 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00935 static const int max_digits10 = 0;
00936 #endif
00937 static const bool is_signed = false;
00938 static const bool is_integer = true;
00939 static const bool is_exact = true;
00940 static const int radix = 2;
00941 static unsigned int epsilon() throw()
00942 { return 0; }
00943 static unsigned int round_error() throw()
00944 { return 0; }
00945
00946 static const int min_exponent = 0;
00947 static const int min_exponent10 = 0;
00948 static const int max_exponent = 0;
00949 static const int max_exponent10 = 0;
00950
00951 static const bool has_infinity = false;
00952 static const bool has_quiet_NaN = false;
00953 static const bool has_signaling_NaN = false;
00954 static const float_denorm_style has_denorm = denorm_absent;
00955 static const bool has_denorm_loss = false;
00956
00957 static unsigned int infinity() throw()
00958 { return static_cast<unsigned int>(0); }
00959 static unsigned int quiet_NaN() throw()
00960 { return static_cast<unsigned int>(0); }
00961 static unsigned int signaling_NaN() throw()
00962 { return static_cast<unsigned int>(0); }
00963 static unsigned int denorm_min() throw()
00964 { return static_cast<unsigned int>(0); }
00965
00966 static const bool is_iec559 = false;
00967 static const bool is_bounded = true;
00968 static const bool is_modulo = true;
00969
00970 static const bool traps = __glibcxx_integral_traps;
00971 static const bool tinyness_before = false;
00972 static const float_round_style round_style = round_toward_zero;
00973 };
00974
00975
00976 template<>
00977 struct numeric_limits<long>
00978 {
00979 static const bool is_specialized = true;
00980
00981 static long min() throw()
00982 { return -__LONG_MAX__ - 1; }
00983 static long max() throw()
00984 { return __LONG_MAX__; }
00985 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00986 static long lowest() throw()
00987 { return min(); }
00988 #endif
00989
00990 static const int digits = __glibcxx_digits (long);
00991 static const int digits10 = __glibcxx_digits10 (long);
00992 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00993 static const int max_digits10 = 0;
00994 #endif
00995 static const bool is_signed = true;
00996 static const bool is_integer = true;
00997 static const bool is_exact = true;
00998 static const int radix = 2;
00999 static long epsilon() throw()
01000 { return 0; }
01001 static long round_error() throw()
01002 { return 0; }
01003
01004 static const int min_exponent = 0;
01005 static const int min_exponent10 = 0;
01006 static const int max_exponent = 0;
01007 static const int max_exponent10 = 0;
01008
01009 static const bool has_infinity = false;
01010 static const bool has_quiet_NaN = false;
01011 static const bool has_signaling_NaN = false;
01012 static const float_denorm_style has_denorm = denorm_absent;
01013 static const bool has_denorm_loss = false;
01014
01015 static long infinity() throw()
01016 { return static_cast<long>(0); }
01017 static long quiet_NaN() throw()
01018 { return static_cast<long>(0); }
01019 static long signaling_NaN() throw()
01020 { return static_cast<long>(0); }
01021 static long denorm_min() throw()
01022 { return static_cast<long>(0); }
01023
01024 static const bool is_iec559 = false;
01025 static const bool is_bounded = true;
01026 static const bool is_modulo = true;
01027
01028 static const bool traps = __glibcxx_integral_traps;
01029 static const bool tinyness_before = false;
01030 static const float_round_style round_style = round_toward_zero;
01031 };
01032
01033
01034 template<>
01035 struct numeric_limits<unsigned long>
01036 {
01037 static const bool is_specialized = true;
01038
01039 static unsigned long min() throw()
01040 { return 0; }
01041 static unsigned long max() throw()
01042 { return __LONG_MAX__ * 2UL + 1; }
01043 #ifdef __GXX_EXPERIMENTAL_CXX0X__
01044 static unsigned long lowest() throw()
01045 { return min(); }
01046 #endif
01047
01048 static const int digits = __glibcxx_digits (unsigned long);
01049 static const int digits10 = __glibcxx_digits10 (unsigned long);
01050 #ifdef __GXX_EXPERIMENTAL_CXX0X__
01051 static const int max_digits10 = 0;
01052 #endif
01053 static const bool is_signed = false;
01054 static const bool is_integer = true;
01055 static const bool is_exact = true;
01056 static const int radix = 2;
01057 static unsigned long epsilon() throw()
01058 { return 0; }
01059 static unsigned long round_error() throw()
01060 { return 0; }
01061
01062 static const int min_exponent = 0;
01063 static const int min_exponent10 = 0;
01064 static const int max_exponent = 0;
01065 static const int max_exponent10 = 0;
01066
01067 static const bool has_infinity = false;
01068 static const bool has_quiet_NaN = false;
01069 static const bool has_signaling_NaN = false;
01070 static const float_denorm_style has_denorm = denorm_absent;
01071 static const bool has_denorm_loss = false;
01072
01073 static unsigned long infinity() throw()
01074 { return static_cast<unsigned long>(0); }
01075 static unsigned long quiet_NaN() throw()
01076 { return static_cast<unsigned long>(0); }
01077 static unsigned long signaling_NaN() throw()
01078 { return static_cast<unsigned long>(0); }
01079 static unsigned long denorm_min() throw()
01080 { return static_cast<unsigned long>(0); }
01081
01082 static const bool is_iec559 = false;
01083 static const bool is_bounded = true;
01084 static const bool is_modulo = true;
01085
01086 static const bool traps = __glibcxx_integral_traps;
01087 static const bool tinyness_before = false;
01088 static const float_round_style round_style = round_toward_zero;
01089 };
01090
01091
01092 template<>
01093 struct numeric_limits<long long>
01094 {
01095 static const bool is_specialized = true;
01096
01097 static long long min() throw()
01098 { return -__LONG_LONG_MAX__ - 1; }
01099 static long long max() throw()
01100 { return __LONG_LONG_MAX__; }
01101 #ifdef __GXX_EXPERIMENTAL_CXX0X__
01102 static long long lowest() throw()
01103 { return min(); }
01104 #endif
01105
01106 static const int digits = __glibcxx_digits (long long);
01107 static const int digits10 = __glibcxx_digits10 (long long);
01108 #ifdef __GXX_EXPERIMENTAL_CXX0X__
01109 static const int max_digits10 = 0;
01110 #endif
01111 static const bool is_signed = true;
01112 static const bool is_integer = true;
01113 static const bool is_exact = true;
01114 static const int radix = 2;
01115 static long long epsilon() throw()
01116 { return 0; }
01117 static long long round_error() throw()
01118 { return 0; }
01119
01120 static const int min_exponent = 0;
01121 static const int min_exponent10 = 0;
01122 static const int max_exponent = 0;
01123 static const int max_exponent10 = 0;
01124
01125 static const bool has_infinity = false;
01126 static const bool has_quiet_NaN = false;
01127 static const bool has_signaling_NaN = false;
01128 static const float_denorm_style has_denorm = denorm_absent;
01129 static const bool has_denorm_loss = false;
01130
01131 static long long infinity() throw()
01132 { return static_cast<long long>(0); }
01133 static long long quiet_NaN() throw()
01134 { return static_cast<long long>(0); }
01135 static long long signaling_NaN() throw()
01136 { return static_cast<long long>(0); }
01137 static long long denorm_min() throw()
01138 { return static_cast<long long>(0); }
01139
01140 static const bool is_iec559 = false;
01141 static const bool is_bounded = true;
01142 static const bool is_modulo = true;
01143
01144 static const bool traps = __glibcxx_integral_traps;
01145 static const bool tinyness_before = false;
01146 static const float_round_style round_style = round_toward_zero;
01147 };
01148
01149
01150 template<>
01151 struct numeric_limits<unsigned long long>
01152 {
01153 static const bool is_specialized = true;
01154
01155 static unsigned long long min() throw()
01156 { return 0; }
01157 static unsigned long long max() throw()
01158 { return __LONG_LONG_MAX__ * 2ULL + 1; }
01159 #ifdef __GXX_EXPERIMENTAL_CXX0X__
01160 static unsigned long long lowest() throw()
01161 { return min(); }
01162 #endif
01163
01164 static const int digits = __glibcxx_digits (unsigned long long);
01165 static const int digits10 = __glibcxx_digits10 (unsigned long long);
01166 #ifdef __GXX_EXPERIMENTAL_CXX0X__
01167 static const int max_digits10 = 0;
01168 #endif
01169 static const bool is_signed = false;
01170 static const bool is_integer = true;
01171 static const bool is_exact = true;
01172 static const int radix = 2;
01173 static unsigned long long epsilon() throw()
01174 { return 0; }
01175 static unsigned long long round_error() throw()
01176 { return 0; }
01177
01178 static const int min_exponent = 0;
01179 static const int min_exponent10 = 0;
01180 static const int max_exponent = 0;
01181 static const int max_exponent10 = 0;
01182
01183 static const bool has_infinity = false;
01184 static const bool has_quiet_NaN = false;
01185 static const bool has_signaling_NaN = false;
01186 static const float_denorm_style has_denorm = denorm_absent;
01187 static const bool has_denorm_loss = false;
01188
01189 static unsigned long long infinity() throw()
01190 { return static_cast<unsigned long long>(0); }
01191 static unsigned long long quiet_NaN() throw()
01192 { return static_cast<unsigned long long>(0); }
01193 static unsigned long long signaling_NaN() throw()
01194 { return static_cast<unsigned long long>(0); }
01195 static unsigned long long denorm_min() throw()
01196 { return static_cast<unsigned long long>(0); }
01197
01198 static const bool is_iec559 = false;
01199 static const bool is_bounded = true;
01200 static const bool is_modulo = true;
01201
01202 static const bool traps = __glibcxx_integral_traps;
01203 static const bool tinyness_before = false;
01204 static const float_round_style round_style = round_toward_zero;
01205 };
01206
01207
01208 template<>
01209 struct numeric_limits<float>
01210 {
01211 static const bool is_specialized = true;
01212
01213 static float min() throw()
01214 { return __FLT_MIN__; }
01215 static float max() throw()
01216 { return __FLT_MAX__; }
01217 #ifdef __GXX_EXPERIMENTAL_CXX0X__
01218 static float lowest() throw()
01219 { return -__FLT_MAX__; }
01220 #endif
01221
01222 static const int digits = __FLT_MANT_DIG__;
01223 static const int digits10 = __FLT_DIG__;
01224 #ifdef __GXX_EXPERIMENTAL_CXX0X__
01225 static const int max_digits10
01226 = __glibcxx_max_digits10 (__FLT_MANT_DIG__);
01227 #endif
01228 static const bool is_signed = true;
01229 static const bool is_integer = false;
01230 static const bool is_exact = false;
01231 static const int radix = __FLT_RADIX__;
01232 static float epsilon() throw()
01233 { return __FLT_EPSILON__; }
01234 static float round_error() throw()
01235 { return 0.5F; }
01236
01237 static const int min_exponent = __FLT_MIN_EXP__;
01238 static const int min_exponent10 = __FLT_MIN_10_EXP__;
01239 static const int max_exponent = __FLT_MAX_EXP__;
01240 static const int max_exponent10 = __FLT_MAX_10_EXP__;
01241
01242 static const bool has_infinity = __FLT_HAS_INFINITY__;
01243 static const bool has_quiet_NaN = __FLT_HAS_QUIET_NAN__;
01244 static const bool has_signaling_NaN = has_quiet_NaN;
01245 static const float_denorm_style has_denorm
01246 = bool(__FLT_HAS_DENORM__) ? denorm_present : denorm_absent;
01247 static const bool has_denorm_loss = __glibcxx_float_has_denorm_loss;
01248
01249 static float infinity() throw()
01250 { return __builtin_huge_valf (); }
01251 static float quiet_NaN() throw()
01252 { return __builtin_nanf (""); }
01253 static float signaling_NaN() throw()
01254 { return __builtin_nansf (""); }
01255 static float denorm_min() throw()
01256 { return __FLT_DENORM_MIN__; }
01257
01258 static const bool is_iec559
01259 = has_infinity && has_quiet_NaN && has_denorm == denorm_present;
01260 static const bool is_bounded = true;
01261 static const bool is_modulo = false;
01262
01263 static const bool traps = __glibcxx_float_traps;
01264 static const bool tinyness_before = __glibcxx_float_tinyness_before;
01265 static const float_round_style round_style = round_to_nearest;
01266 };
01267
01268 #undef __glibcxx_float_has_denorm_loss
01269 #undef __glibcxx_float_traps
01270 #undef __glibcxx_float_tinyness_before
01271
01272
01273 template<>
01274 struct numeric_limits<double>
01275 {
01276 static const bool is_specialized = true;
01277
01278 static double min() throw()
01279 { return __DBL_MIN__; }
01280 static double max() throw()
01281 { return __DBL_MAX__; }
01282 #ifdef __GXX_EXPERIMENTAL_CXX0X__
01283 static double lowest() throw()
01284 { return -__DBL_MAX__; }
01285 #endif
01286
01287 static const int digits = __DBL_MANT_DIG__;
01288 static const int digits10 = __DBL_DIG__;
01289 #ifdef __GXX_EXPERIMENTAL_CXX0X__
01290 static const int max_digits10
01291 = __glibcxx_max_digits10 (__DBL_MANT_DIG__);
01292 #endif
01293 static const bool is_signed = true;
01294 static const bool is_integer = false;
01295 static const bool is_exact = false;
01296 static const int radix = __FLT_RADIX__;
01297 static double epsilon() throw()
01298 { return __DBL_EPSILON__; }
01299 static double round_error() throw()
01300 { return 0.5; }
01301
01302 static const int min_exponent = __DBL_MIN_EXP__;
01303 static const int min_exponent10 = __DBL_MIN_10_EXP__;
01304 static const int max_exponent = __DBL_MAX_EXP__;
01305 static const int max_exponent10 = __DBL_MAX_10_EXP__;
01306
01307 static const bool has_infinity = __DBL_HAS_INFINITY__;
01308 static const bool has_quiet_NaN = __DBL_HAS_QUIET_NAN__;
01309 static const bool has_signaling_NaN = has_quiet_NaN;
01310 static const float_denorm_style has_denorm
01311 = bool(__DBL_HAS_DENORM__) ? denorm_present : denorm_absent;
01312 static const bool has_denorm_loss = __glibcxx_double_has_denorm_loss;
01313
01314 static double infinity() throw()
01315 { return __builtin_huge_val(); }
01316 static double quiet_NaN() throw()
01317 { return __builtin_nan (""); }
01318 static double signaling_NaN() throw()
01319 { return __builtin_nans (""); }
01320 static double denorm_min() throw()
01321 { return __DBL_DENORM_MIN__; }
01322
01323 static const bool is_iec559
01324 = has_infinity && has_quiet_NaN && has_denorm == denorm_present;
01325 static const bool is_bounded = true;
01326 static const bool is_modulo = false;
01327
01328 static const bool traps = __glibcxx_double_traps;
01329 static const bool tinyness_before = __glibcxx_double_tinyness_before;
01330 static const float_round_style round_style = round_to_nearest;
01331 };
01332
01333 #undef __glibcxx_double_has_denorm_loss
01334 #undef __glibcxx_double_traps
01335 #undef __glibcxx_double_tinyness_before
01336
01337
01338 template<>
01339 struct numeric_limits<long double>
01340 {
01341 static const bool is_specialized = true;
01342
01343 static long double min() throw()
01344 { return __LDBL_MIN__; }
01345 static long double max() throw()
01346 { return __LDBL_MAX__; }
01347 #ifdef __GXX_EXPERIMENTAL_CXX0X__
01348 static long double lowest() throw()
01349 { return -__LDBL_MAX__; }
01350 #endif
01351
01352 static const int digits = __LDBL_MANT_DIG__;
01353 static const int digits10 = __LDBL_DIG__;
01354 #ifdef __GXX_EXPERIMENTAL_CXX0X__
01355 static const int max_digits10
01356 = __glibcxx_max_digits10 (__LDBL_MANT_DIG__);
01357 #endif
01358 static const bool is_signed = true;
01359 static const bool is_integer = false;
01360 static const bool is_exact = false;
01361 static const int radix = __FLT_RADIX__;
01362 static long double epsilon() throw()
01363 { return __LDBL_EPSILON__; }
01364 static long double round_error() throw()
01365 { return 0.5L; }
01366
01367 static const int min_exponent = __LDBL_MIN_EXP__;
01368 static const int min_exponent10 = __LDBL_MIN_10_EXP__;
01369 static const int max_exponent = __LDBL_MAX_EXP__;
01370 static const int max_exponent10 = __LDBL_MAX_10_EXP__;
01371
01372 static const bool has_infinity = __LDBL_HAS_INFINITY__;
01373 static const bool has_quiet_NaN = __LDBL_HAS_QUIET_NAN__;
01374 static const bool has_signaling_NaN = has_quiet_NaN;
01375 static const float_denorm_style has_denorm
01376 = bool(__LDBL_HAS_DENORM__) ? denorm_present : denorm_absent;
01377 static const bool has_denorm_loss
01378 = __glibcxx_long_double_has_denorm_loss;
01379
01380 static long double infinity() throw()
01381 { return __builtin_huge_vall (); }
01382 static long double quiet_NaN() throw()
01383 { return __builtin_nanl (""); }
01384 static long double signaling_NaN() throw()
01385 { return __builtin_nansl (""); }
01386 static long double denorm_min() throw()
01387 { return __LDBL_DENORM_MIN__; }
01388
01389 static const bool is_iec559
01390 = has_infinity && has_quiet_NaN && has_denorm == denorm_present;
01391 static const bool is_bounded = true;
01392 static const bool is_modulo = false;
01393
01394 static const bool traps = __glibcxx_long_double_traps;
01395 static const bool tinyness_before = __glibcxx_long_double_tinyness_before;
01396 static const float_round_style round_style = round_to_nearest;
01397 };
01398
01399 #undef __glibcxx_long_double_has_denorm_loss
01400 #undef __glibcxx_long_double_traps
01401 #undef __glibcxx_long_double_tinyness_before
01402
01403 _GLIBCXX_END_NAMESPACE
01404
01405 #undef __glibcxx_signed
01406 #undef __glibcxx_min
01407 #undef __glibcxx_max
01408 #undef __glibcxx_digits
01409 #undef __glibcxx_digits10
01410 #undef __glibcxx_max_digits10
01411
01412 #endif // _GLIBCXX_NUMERIC_LIMITS