Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

limits_generic.h

Go to the documentation of this file.
00001 // The template and inlines for the -*- C++ -*- numeric_limits classes.
00002 
00003 // Copyright (C) 2000-2001 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 2, 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 // You should have received a copy of the GNU General Public License along
00017 // with this library; see the file COPYING.  If not, write to the Free
00018 // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
00019 // USA.
00020 
00021 // As a special exception, you may use this file as part of a free software
00022 // library without restriction.  Specifically, if other files instantiate
00023 // templates or use macros or inline functions from this file, or you compile
00024 // this file and link it with other files to produce an executable, this
00025 // file does not by itself cause the resulting executable to be covered by
00026 // the GNU General Public License.  This exception does not however
00027 // invalidate any other reasons why the executable file might be covered by
00028 // the GNU General Public License.
00029 
00030 // Note: this is not a conforming implementation.
00031 // Written by Gabriel Dos Reis <Gabriel.Dos-Reis@cmla.ens-cachan.fr>
00032 
00033 //
00034 // ISO 14882:1998
00035 // 18.2.1
00036 //
00037 
00038 #ifndef _CPP_NUMERIC_LIMITS
00039 #define _CPP_NUMERIC_LIMITS 1
00040 
00041 #pragma GCC system_header
00042 
00043 #include <bits/c++config.h>
00044 #include <bits/std_cfloat.h>
00045 #include <bits/std_climits.h>
00046 #if defined( _GLIBCPP_USE_WCHAR_T) 
00047 #include <bits/std_cwchar.h>
00048 #endif
00049 
00050 namespace std {
00051 
00052     enum float_round_style {
00053         round_indeterminate       = -1,
00054         round_toward_zero         = 0,
00055         round_to_nearest          = 1,
00056         round_toward_infinity     = 2,
00057         round_toward_neg_infinity = 3
00058     };
00059 
00060     enum float_denorm_style {
00061         denorm_indeterminate = -1,
00062         denorm_absent        = 0,
00063         denorm_present       = 1
00064     };
00065 
00066     template<typename _T> struct numeric_limits {
00067         static const bool is_specialized = false;
00068 
00069         static _T min() throw() { return static_cast<_T>(0); }
00070         static _T max() throw() { return static_cast<_T>(0); }
00071 
00072         static const int digits = 0;
00073         static const int digits10 = 0;
00074         static const bool is_signed = false;
00075         static const bool is_integer = false;
00076         static const bool is_exact = false;
00077         static const int radix = 0;
00078 
00079         static _T epsilon() throw() { return static_cast<_T>(0); }
00080         static _T round_error() throw() { return static_cast<_T>(0); }
00081 
00082         static const int min_exponent = 0;
00083         static const int min_exponent10 = 0;
00084         static const int max_exponent = 0;
00085         static const int max_exponent10 = 0;
00086 
00087         static const bool has_infinity = false;
00088         static const bool has_quiet_NaN = false;
00089         static const bool has_signaling_NaN = false;
00090         static const float_denorm_style has_denorm = denorm_absent;
00091         static const bool has_denorm_loss = false;
00092 
00093         static _T infinity() throw()  { return static_cast<_T>(0); }
00094         static _T quiet_NaN() throw() { return static_cast<_T>(0); }
00095         static _T signaling_NaN() throw() { return static_cast<_T>(0); }
00096         static _T denorm_min() throw() { return static_cast<_T>(0); }
00097 
00098         static const bool is_iec559 = false;
00099         static const bool is_bounded = false;
00100         static const bool is_modulo = false;
00101 
00102         static const bool traps = false;
00103         static const bool tinyness_before = false;
00104         static const float_round_style round_style = round_toward_zero;
00105     };
00106 
00107     template<typename _T> _T __limits_infinity();
00108     template<typename _T> _T __limits_quiet_NaN();
00109     template<typename _T> _T __limits_signaling_NaN();
00110     template<typename _T> _T __limits_denorm_min();
00111 
00112     template<> struct numeric_limits<bool> {
00113         static const bool is_specialized = true;
00114 
00115         static bool min() throw()
00116         { return false; }
00117         static bool max() throw()
00118         { return true; }
00119 
00120         static const int digits = 8;
00121         static const int digits10 = 2;
00122         static const bool is_signed = false;
00123         static const bool is_integer = true;
00124         static const bool is_exact = true;
00125         static const int radix = 2;
00126         static bool epsilon() throw()
00127         { return 0; }
00128         static bool round_error() throw()
00129         { return 0; }
00130 
00131         static const int min_exponent = 0;
00132         static const int min_exponent10 = 0;
00133         static const int max_exponent = 0;
00134         static const int max_exponent10 = 0;
00135 
00136         static const bool has_infinity = false;
00137         static const bool has_quiet_NaN = false;
00138         static const bool has_signaling_NaN = false;
00139         static const float_denorm_style has_denorm = denorm_absent;
00140         static const bool has_denorm_loss = false;
00141 
00142         static bool infinity() throw()
00143         { return static_cast<bool>(0); }
00144         static bool quiet_NaN() throw()
00145         { return static_cast<bool>(0); }
00146         static bool signaling_NaN() throw()
00147         { return static_cast<bool>(0); }
00148         static bool denorm_min() throw()
00149         { return static_cast<bool>(0); }
00150 
00151         static const bool is_iec559 = true;
00152         static const bool is_bounded = true;
00153         static const bool is_modulo = true;
00154 
00155         static const bool traps = false;
00156         static const bool tinyness_before = false;
00157         static const float_round_style round_style = round_toward_zero;
00158     };
00159 
00160     template<> struct numeric_limits<char> {
00161         static const bool is_specialized = true;
00162 
00163         static char min() throw()
00164         { return CHAR_MIN; }
00165         static char max() throw()
00166         { return CHAR_MAX; }
00167 
00168         static const int digits = 7;
00169         static const int digits10 = 2;
00170         static const bool is_signed = true;
00171         static const bool is_integer = true;
00172         static const bool is_exact = true;
00173         static const int radix = 2;
00174         static char epsilon() throw()
00175         { return 0; }
00176         static char round_error() throw()
00177         { return 0; }
00178 
00179         static const int min_exponent = 0;
00180         static const int min_exponent10 = 0;
00181         static const int max_exponent = 0;
00182         static const int max_exponent10 = 0;
00183 
00184         static const bool has_infinity = false;
00185         static const bool has_quiet_NaN = false;
00186         static const bool has_signaling_NaN = false;
00187         static const float_denorm_style has_denorm = denorm_absent;
00188         static const bool has_denorm_loss = false;
00189 
00190         static char infinity() throw()
00191         { return static_cast<char>(0); }
00192         static char quiet_NaN() throw()
00193         { return static_cast<char>(0); }
00194         static char signaling_NaN() throw()
00195         { return static_cast<char>(0); }
00196         static char denorm_min() throw()
00197         { return static_cast<char>(0); }
00198 
00199         static const bool is_iec559 = false;
00200         static const bool is_bounded = true;
00201         static const bool is_modulo = false;
00202 
00203         static const bool traps = false;
00204         static const bool tinyness_before = false;
00205         static const float_round_style round_style = round_toward_zero;
00206     };
00207 
00208     template<> struct numeric_limits<signed char> {
00209         static const bool is_specialized = true;
00210 
00211         static signed char min() throw()
00212         { return SCHAR_MIN; }
00213         static signed char max() throw()
00214         { return SCHAR_MAX; }
00215 
00216         static const int digits = 7;
00217         static const int digits10 = 2;
00218         static const bool is_signed = true;
00219         static const bool is_integer = true;
00220         static const bool is_exact = true;
00221         static const int radix = 2;
00222         static signed char epsilon() throw()
00223         { return 0; }
00224         static signed char round_error() throw()
00225         { return 0; }
00226 
00227         static const int min_exponent = 0;
00228         static const int min_exponent10 = 0;
00229         static const int max_exponent = 0;
00230         static const int max_exponent10 = 0;
00231 
00232         static const bool has_infinity = false;
00233         static const bool has_quiet_NaN = false;
00234         static const bool has_signaling_NaN = false;
00235         static const float_denorm_style has_denorm = denorm_absent;
00236         static const bool has_denorm_loss = false;
00237 
00238         static signed char infinity() throw()
00239         { return static_cast<signed char>(0); }
00240         static signed char quiet_NaN() throw()
00241         { return static_cast<signed char>(0); }
00242         static signed char signaling_NaN() throw()
00243         { return static_cast<signed char>(0); }
00244         static signed char denorm_min() throw()
00245         { return static_cast<signed char>(0); }
00246 
00247         static const bool is_iec559 = false;
00248         static const bool is_bounded = true;
00249         static const bool is_modulo = false;
00250 
00251         static const bool traps = false;
00252         static const bool tinyness_before = false;
00253         static const float_round_style round_style = round_toward_zero;
00254     };
00255 
00256     template<> struct numeric_limits<unsigned char> {
00257         static const bool is_specialized = true;
00258 
00259         static unsigned char min() throw()
00260         { return 0; }
00261         static unsigned char max() throw()
00262         { return UCHAR_MAX; }
00263 
00264         static const int digits = 8;
00265         static const int digits10 = 2;
00266         static const bool is_signed = false;
00267         static const bool is_integer = true;
00268         static const bool is_exact = true;
00269         static const int radix = 2;
00270         static unsigned char epsilon() throw()
00271         { return 0; }
00272         static unsigned char round_error() throw()
00273         { return 0; }
00274 
00275         static const int min_exponent = 0;
00276         static const int min_exponent10 = 0;
00277         static const int max_exponent = 0;
00278         static const int max_exponent10 = 0;
00279 
00280         static const bool has_infinity = false;
00281         static const bool has_quiet_NaN = false;
00282         static const bool has_signaling_NaN = false;
00283         static const float_denorm_style has_denorm = denorm_absent;
00284         static const bool has_denorm_loss = false;
00285 
00286         static unsigned char infinity() throw()
00287         { return static_cast<unsigned char>(0); }
00288         static unsigned char quiet_NaN() throw()
00289         { return static_cast<unsigned char>(0); }
00290         static unsigned char signaling_NaN() throw()
00291         { return static_cast<unsigned char>(0); }
00292         static unsigned char denorm_min() throw()
00293         { return static_cast<unsigned char>(0); }
00294 
00295         static const bool is_iec559 = false;
00296         static const bool is_bounded = true;
00297         static const bool is_modulo = true;
00298 
00299         static const bool traps = true;
00300         static const bool tinyness_before = false;
00301         static const float_round_style round_style = round_toward_zero;
00302     };
00303 
00304 #if defined( _GLIBCPP_USE_WCHAR_T) 
00305     template<> struct numeric_limits<wchar_t> {
00306         static const bool is_specialized = true;
00307 
00308         static wchar_t min() throw()
00309         { return WCHAR_MIN; }
00310         static wchar_t max() throw()
00311         { return WCHAR_MAX; }
00312 
00313         static const int digits = 31;
00314         static const int digits10 = 9;
00315         static const bool is_signed = true;
00316         static const bool is_integer = true;
00317         static const bool is_exact = true;
00318         static const int radix = 2;
00319         static wchar_t epsilon() throw()
00320         { return 0; }
00321         static wchar_t round_error() throw()
00322         { return 0; }
00323 
00324         static const int min_exponent = 0;
00325         static const int min_exponent10 = 0;
00326         static const int max_exponent = 0;
00327         static const int max_exponent10 = 0;
00328 
00329         static const bool has_infinity = false;
00330         static const bool has_quiet_NaN = false;
00331         static const bool has_signaling_NaN = false;
00332         static const float_denorm_style has_denorm = denorm_absent;
00333         static const bool has_denorm_loss = false;
00334 
00335         static wchar_t infinity() throw()
00336         { return static_cast<wchar_t>(0); }
00337         static wchar_t quiet_NaN() throw()
00338         { return static_cast<wchar_t>(0); }
00339         static wchar_t signaling_NaN() throw()
00340         { return static_cast<wchar_t>(0); }
00341         static wchar_t denorm_min() throw()
00342         { return static_cast<wchar_t>(0); }
00343 
00344         static const bool is_iec559 = false;
00345         static const bool is_bounded = true;
00346         static const bool is_modulo = false;
00347 
00348         static const bool traps = false;
00349         static const bool tinyness_before = false;
00350         static const float_round_style round_style = round_toward_zero;
00351     };
00352 #endif
00353 
00354     template<> struct numeric_limits<short> {
00355         static const bool is_specialized = true;
00356 
00357         static short min() throw()
00358         { return SHRT_MIN; }
00359         static short max() throw()
00360         { return SHRT_MAX; }
00361 
00362         static const int digits = 15;
00363         static const int digits10 = 4;
00364         static const bool is_signed = true;
00365         static const bool is_integer = true;
00366         static const bool is_exact = true;
00367         static const int radix = 2;
00368         static short epsilon() throw()
00369         { return 0; }
00370         static short round_error() throw()
00371         { return 0; }
00372 
00373         static const int min_exponent = 0;
00374         static const int min_exponent10 = 0;
00375         static const int max_exponent = 0;
00376         static const int max_exponent10 = 0;
00377 
00378         static const bool has_infinity = false;
00379         static const bool has_quiet_NaN = false;
00380         static const bool has_signaling_NaN = false;
00381         static const float_denorm_style has_denorm = denorm_absent;
00382         static const bool has_denorm_loss = false;
00383 
00384         static short infinity() throw()
00385         { return static_cast<short>(0); }
00386         static short quiet_NaN() throw()
00387         { return static_cast<short>(0); }
00388         static short signaling_NaN() throw()
00389         { return static_cast<short>(0); }
00390         static short denorm_min() throw()
00391         { return static_cast<short>(0); }
00392 
00393         static const bool is_iec559 = false;
00394         static const bool is_bounded = true;
00395         static const bool is_modulo = false;
00396 
00397         static const bool traps = false;
00398         static const bool tinyness_before = false;
00399         static const float_round_style round_style = round_toward_zero;
00400     };
00401 
00402     template<> struct numeric_limits<unsigned short> {
00403         static const bool is_specialized = true;
00404 
00405         static unsigned short min() throw()
00406         { return 0; }
00407         static unsigned short max() throw()
00408         { return USHRT_MAX; }
00409 
00410         static const int digits = 16;
00411         static const int digits10 = 4;
00412         static const bool is_signed = false;
00413         static const bool is_integer = true;
00414         static const bool is_exact = true;
00415         static const int radix = 2;
00416         static unsigned short epsilon() throw()
00417         { return 0; }
00418         static unsigned short round_error() throw()
00419         { return 0; }
00420 
00421         static const int min_exponent = 0;
00422         static const int min_exponent10 = 0;
00423         static const int max_exponent = 0;
00424         static const int max_exponent10 = 0;
00425 
00426         static const bool has_infinity = false;
00427         static const bool has_quiet_NaN = false;
00428         static const bool has_signaling_NaN = false;
00429         static const float_denorm_style has_denorm = denorm_absent;
00430         static const bool has_denorm_loss = false;
00431 
00432         static unsigned short infinity() throw()
00433         { return static_cast<unsigned short>(0); }
00434         static unsigned short quiet_NaN() throw()
00435         { return static_cast<unsigned short>(0); }
00436         static unsigned short signaling_NaN() throw()
00437         { return static_cast<unsigned short>(0); }
00438         static unsigned short denorm_min() throw()
00439         { return static_cast<unsigned short>(0); }
00440 
00441         static const bool is_iec559 = false;
00442         static const bool is_bounded = true;
00443         static const bool is_modulo = true;
00444 
00445         static const bool traps = true;
00446         static const bool tinyness_before = false;
00447         static const float_round_style round_style = round_toward_zero;
00448     };
00449 
00450     template<> struct numeric_limits<int> {
00451         static const bool is_specialized = true;
00452 
00453         static int min() throw()
00454         { return INT_MIN; }
00455         static int max() throw()
00456         { return INT_MAX; }
00457 
00458         static const int digits = 31;
00459         static const int digits10 = 9;
00460         static const bool is_signed = true;
00461         static const bool is_integer = true;
00462         static const bool is_exact = true;
00463         static const int radix = 2;
00464         static int epsilon() throw()
00465         { return 0; }
00466         static int round_error() throw()
00467         { return 0; }
00468 
00469         static const int min_exponent = 0;
00470         static const int min_exponent10 = 0;
00471         static const int max_exponent = 0;
00472         static const int max_exponent10 = 0;
00473 
00474         static const bool has_infinity = false;
00475         static const bool has_quiet_NaN = false;
00476         static const bool has_signaling_NaN = false;
00477         static const float_denorm_style has_denorm = denorm_absent;
00478         static const bool has_denorm_loss = false;
00479 
00480         static int infinity() throw()
00481         { return static_cast<int>(0); }
00482         static int quiet_NaN() throw()
00483         { return static_cast<int>(0); }
00484         static int signaling_NaN() throw()
00485         { return static_cast<int>(0); }
00486         static int denorm_min() throw()
00487         { return static_cast<int>(0); }
00488 
00489         static const bool is_iec559 = true;
00490         static const bool is_bounded = true;
00491         static const bool is_modulo = false;
00492 
00493         static const bool traps = false;
00494         static const bool tinyness_before = false;
00495         static const float_round_style round_style = round_toward_zero;
00496     };
00497 
00498     template<> struct numeric_limits<unsigned int> {
00499         static const bool is_specialized = true;
00500 
00501         static unsigned int min() throw()
00502         { return 0; }
00503         static unsigned int max() throw()
00504         { return UINT_MAX; }
00505 
00506         static const int digits = 32;
00507         static const int digits10 = 9;
00508         static const bool is_signed = false;
00509         static const bool is_integer = true;
00510         static const bool is_exact = true;
00511         static const int radix = 2;
00512         static unsigned int epsilon() throw()
00513         { return 0; }
00514         static unsigned int round_error() throw()
00515         { return 0; }
00516 
00517         static const int min_exponent = 0;
00518         static const int min_exponent10 = 0;
00519         static const int max_exponent = 0;
00520         static const int max_exponent10 = 0;
00521 
00522         static const bool has_infinity = false;
00523         static const bool has_quiet_NaN = false;
00524         static const bool has_signaling_NaN = false;
00525         static const float_denorm_style has_denorm = denorm_absent;
00526         static const bool has_denorm_loss = false;
00527 
00528         static unsigned int infinity() throw()
00529         { return static_cast<unsigned int>(0); }
00530         static unsigned int quiet_NaN() throw()
00531         { return static_cast<unsigned int>(0); }
00532         static unsigned int signaling_NaN() throw()
00533         { return static_cast<unsigned int>(0); }
00534         static unsigned int denorm_min() throw()
00535         { return static_cast<unsigned int>(0); }
00536 
00537         static const bool is_iec559 = true;
00538         static const bool is_bounded = true;
00539         static const bool is_modulo = true;
00540 
00541         static const bool traps = true;
00542         static const bool tinyness_before = false;
00543         static const float_round_style round_style = round_toward_zero;
00544     };
00545 
00546     template<> struct numeric_limits<long> {
00547         static const bool is_specialized = true;
00548 
00549         static long min() throw()
00550         { return LONG_MIN; }
00551         static long max() throw()
00552         { return LONG_MAX; }
00553 
00554         static const int digits = 31;
00555         static const int digits10 = 9;
00556         static const bool is_signed = true;
00557         static const bool is_integer = true;
00558         static const bool is_exact = true;
00559         static const int radix = 2;
00560         static long epsilon() throw()
00561         { return 0; }
00562         static long round_error() throw()
00563         { return 0; }
00564 
00565         static const int min_exponent = 0;
00566         static const int min_exponent10 = 0;
00567         static const int max_exponent = 0;
00568         static const int max_exponent10 = 0;
00569 
00570         static const bool has_infinity = false;
00571         static const bool has_quiet_NaN = false;
00572         static const bool has_signaling_NaN = false;
00573         static const float_denorm_style has_denorm = denorm_absent;
00574         static const bool has_denorm_loss = false;
00575 
00576         static long infinity() throw()
00577         { return static_cast<long>(0); }
00578         static long quiet_NaN() throw()
00579         { return static_cast<long>(0); }
00580         static long signaling_NaN() throw()
00581         { return static_cast<long>(0); }
00582         static long denorm_min() throw()
00583         { return static_cast<long>(0); }
00584 
00585         static const bool is_iec559 = true;
00586         static const bool is_bounded = true;
00587         static const bool is_modulo = false;
00588 
00589         static const bool traps = false;
00590         static const bool tinyness_before = false;
00591         static const float_round_style round_style = round_toward_zero;
00592     };
00593 
00594     template<> struct numeric_limits<unsigned long> {
00595         static const bool is_specialized = true;
00596 
00597         static unsigned long min() throw()
00598         { return 0; }
00599         static unsigned long max() throw()
00600         { return ULONG_MAX; }
00601 
00602         static const int digits = 32;
00603         static const int digits10 = 9;
00604         static const bool is_signed = false;
00605         static const bool is_integer = true;
00606         static const bool is_exact = true;
00607         static const int radix = 2;
00608         static unsigned long epsilon() throw()
00609         { return 0; }
00610         static unsigned long round_error() throw()
00611         { return 0; }
00612 
00613         static const int min_exponent = 0;
00614         static const int min_exponent10 = 0;
00615         static const int max_exponent = 0;
00616         static const int max_exponent10 = 0;
00617 
00618         static const bool has_infinity = false;
00619         static const bool has_quiet_NaN = false;
00620         static const bool has_signaling_NaN = false;
00621         static const float_denorm_style has_denorm = denorm_absent;
00622         static const bool has_denorm_loss = false;
00623 
00624         static unsigned long infinity() throw()
00625         { return static_cast<unsigned long>(0); }
00626         static unsigned long quiet_NaN() throw()
00627         { return static_cast<unsigned long>(0); }
00628         static unsigned long signaling_NaN() throw()
00629         { return static_cast<unsigned long>(0); }
00630         static unsigned long denorm_min() throw()
00631         { return static_cast<unsigned long>(0); }
00632 
00633         static const bool is_iec559 = true;
00634         static const bool is_bounded = true;
00635         static const bool is_modulo = true;
00636 
00637         static const bool traps = true;
00638         static const bool tinyness_before = false;
00639         static const float_round_style round_style = round_toward_zero;
00640     };
00641 
00642     template<> struct numeric_limits<float> {
00643         static const bool is_specialized = true;
00644 
00645         static float min() throw()
00646         { return FLT_MIN; }
00647         static float max() throw()
00648         { return FLT_MAX; }
00649 
00650         static const int digits = FLT_MANT_DIG;
00651         static const int digits10 = FLT_DIG;
00652         static const bool is_signed = true;
00653         static const bool is_integer = false;
00654         static const bool is_exact = false;
00655         static const int radix = FLT_RADIX;
00656         static float epsilon() throw()
00657         { return FLT_EPSILON; }
00658         static float round_error() throw()
00659         { return FLT_ROUNDS; }
00660 
00661         static const int min_exponent = FLT_MIN_EXP;
00662         static const int min_exponent10 = FLT_MIN_10_EXP;
00663         static const int max_exponent = FLT_MAX_EXP;
00664         static const int max_exponent10 = FLT_MAX_10_EXP;
00665 
00666         static const bool has_infinity = false;
00667         static const bool has_quiet_NaN = false;
00668         static const bool has_signaling_NaN = false;
00669         static const float_denorm_style has_denorm = denorm_absent;
00670         static const bool has_denorm_loss = false;
00671 
00672         static float infinity() throw()
00673         { return static_cast<float>(0); }
00674         static float quiet_NaN() throw()
00675         { return static_cast<float>(0); }
00676         static float signaling_NaN() throw()
00677         { return static_cast<float>(0); }
00678         static float denorm_min() throw()
00679         { return static_cast<float>(0); }
00680 
00681         static const bool is_iec559 = false;
00682         static const bool is_bounded = true;
00683         static const bool is_modulo = false;
00684 
00685         static const bool traps = false;
00686         static const bool tinyness_before = false;
00687         static const float_round_style round_style = round_toward_zero;
00688     };
00689 
00690     template<> struct numeric_limits<double> {
00691         static const bool is_specialized = true;
00692 
00693         static double min() throw()
00694         { return DBL_MIN; }
00695         static double max() throw()
00696         { return DBL_MAX; }
00697 
00698         static const int digits = DBL_MANT_DIG;
00699         static const int digits10 = DBL_DIG;
00700         static const bool is_signed = true;
00701         static const bool is_integer = false;
00702         static const bool is_exact = false;
00703         static const int radix = 2;
00704         static double epsilon() throw()
00705         { return DBL_EPSILON; }
00706         static double round_error() throw()
00707         { return 1.0; }
00708 
00709         static const int min_exponent = DBL_MIN_EXP;
00710         static const int min_exponent10 = DBL_MIN_10_EXP;
00711         static const int max_exponent = DBL_MAX_EXP;
00712         static const int max_exponent10 = DBL_MAX_10_EXP;
00713 
00714         static const bool has_infinity = false;
00715         static const bool has_quiet_NaN = false;
00716         static const bool has_signaling_NaN = false;
00717         static const float_denorm_style has_denorm = denorm_absent;
00718         static const bool has_denorm_loss = false;
00719 
00720         static double infinity() throw()
00721         { return static_cast<double>(0); }
00722         static double quiet_NaN() throw()
00723         { return static_cast<double>(0); }
00724         static double signaling_NaN() throw()
00725         { return static_cast<double>(0); }
00726         static double denorm_min() throw()
00727         { return static_cast<double>(0); }
00728 
00729         static const bool is_iec559 = false;
00730         static const bool is_bounded = true;
00731         static const bool is_modulo = false;
00732 
00733         static const bool traps = false;
00734         static const bool tinyness_before = false;
00735         static const float_round_style round_style = round_toward_zero;
00736     };
00737 
00738     template<> struct numeric_limits<long double> {
00739         static const bool is_specialized = true;
00740 
00741         static double min() throw()
00742         { return LDBL_MIN; }
00743         static double max() throw()
00744         { return LDBL_MAX; }
00745 
00746         static const int digits = LDBL_MANT_DIG;
00747         static const int digits10 = LDBL_DIG;
00748         static const bool is_signed = true;
00749         static const bool is_integer = false;
00750         static const bool is_exact = false;
00751         static const int radix = 2;
00752         static double epsilon() throw()
00753         { return LDBL_EPSILON; }
00754         static double round_error() throw()
00755         { return 1.0L; }
00756 
00757         static const int min_exponent = LDBL_MIN_EXP;
00758         static const int min_exponent10 = LDBL_MIN_10_EXP;
00759         static const int max_exponent = LDBL_MAX_EXP;
00760         static const int max_exponent10 = LDBL_MAX_10_EXP;
00761 
00762         static const bool has_infinity = false;
00763         static const bool has_quiet_NaN = false;
00764         static const bool has_signaling_NaN = false;
00765         static const float_denorm_style has_denorm = denorm_absent;
00766         static const bool has_denorm_loss = false;
00767 
00768         static double infinity() throw()
00769         { return static_cast<double>(0); }
00770         static double quiet_NaN() throw()
00771         { return static_cast<double>(0); }
00772         static double signaling_NaN() throw()
00773         { return static_cast<double>(0); }
00774         static double denorm_min() throw()
00775         { return static_cast<double>(0); }
00776 
00777         static const bool is_iec559 = false;
00778         static const bool is_bounded = true;
00779         static const bool is_modulo = false;
00780 
00781         static const bool traps = false;
00782         static const bool tinyness_before = false;
00783         static const float_round_style round_style = round_toward_zero;
00784     };
00785 
00786 } // namespace std
00787 
00788 #endif // _CPP_NUMERIC_LIMITS

Generated at Tue May 1 16:28:38 2001 for libstdc++-v3 by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001