Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygen_limits.h
Go to the documentation of this file.
00001 /* 00002 * Copyright (c) 1997 00003 * Silicon Graphics Computer Systems, Inc. 00004 * 00005 * Copyright (c) 1999 00006 * Boris Fomitchev 00007 * 00008 * This material is provided "as is", with absolutely no warranty expressed 00009 * or implied. Any use is at your own risk. 00010 * 00011 * Permission to use or copy this software for any purpose is hereby granted 00012 * without fee, provided the above notices are retained on all copies. 00013 * Permission to modify the code and to distribute modified code is granted, 00014 * provided the above notices are retained, and a notice that the code was 00015 * modified is included with the above copyright notice. 00016 * 00017 */ 00018 00019 /* NOTE: This may be not portable code. Parts of numeric_limits<> are 00020 * inherently machine-dependent. At present this file is suitable 00021 * for the MIPS, SPARC, Alpha and ia32 architectures. 00022 */ 00023 00024 #ifndef _STLP_INTERNAL_LIMITS 00025 #define _STLP_INTERNAL_LIMITS 00026 00027 #ifndef _STLP_CLIMITS 00028 # include <climits> 00029 #endif 00030 00031 #ifndef _STLP_CFLOAT 00032 # include <cfloat> 00033 #endif 00034 00035 #if defined (_STLP_HAS_WCHAR_T) && !defined (_STLP_INTERNAL_CWCHAR) 00036 # include <stl/_cwchar.h> 00037 #endif 00038 00039 _STLP_BEGIN_NAMESPACE 00040 00041 enum float_round_style { 00042 round_indeterminate = -1, 00043 round_toward_zero = 0, 00044 round_to_nearest = 1, 00045 round_toward_infinity = 2, 00046 round_toward_neg_infinity = 3 00047 }; 00048 00049 enum float_denorm_style { 00050 denorm_indeterminate = -1, 00051 denorm_absent = 0, 00052 denorm_present = 1 00053 }; 00054 00055 #ifdef min 00056 # undef min 00057 #endif 00058 #ifdef max 00059 # undef max 00060 #endif 00061 00062 _STLP_MOVE_TO_PRIV_NAMESPACE 00063 00064 // Base class for all specializations of numeric_limits. 00065 template <class __number> 00066 class _Numeric_limits_base { 00067 public: 00068 00069 static __number _STLP_CALL min() _STLP_NOTHROW { return __number(); } 00070 static __number _STLP_CALL max() _STLP_NOTHROW { return __number(); } 00071 00072 _STLP_STATIC_CONSTANT(int, digits = 0); 00073 _STLP_STATIC_CONSTANT(int, digits10 = 0); 00074 _STLP_STATIC_CONSTANT(int, radix = 0); 00075 _STLP_STATIC_CONSTANT(int, min_exponent = 0); 00076 _STLP_STATIC_CONSTANT(int, min_exponent10 = 0); 00077 _STLP_STATIC_CONSTANT(int, max_exponent = 0); 00078 _STLP_STATIC_CONSTANT(int, max_exponent10 = 0); 00079 00080 _STLP_STATIC_CONSTANT(float_denorm_style, has_denorm = denorm_absent); 00081 _STLP_STATIC_CONSTANT(float_round_style, round_style = round_toward_zero); 00082 00083 _STLP_STATIC_CONSTANT(bool, is_specialized = false); 00084 _STLP_STATIC_CONSTANT(bool, is_signed = false); 00085 _STLP_STATIC_CONSTANT(bool, is_integer = false); 00086 _STLP_STATIC_CONSTANT(bool, is_exact = false); 00087 _STLP_STATIC_CONSTANT(bool, has_infinity = false); 00088 _STLP_STATIC_CONSTANT(bool, has_quiet_NaN = false); 00089 _STLP_STATIC_CONSTANT(bool, has_signaling_NaN = false); 00090 _STLP_STATIC_CONSTANT(bool, has_denorm_loss = false); 00091 _STLP_STATIC_CONSTANT(bool, is_iec559 = false); 00092 _STLP_STATIC_CONSTANT(bool, is_bounded = false); 00093 _STLP_STATIC_CONSTANT(bool, is_modulo = false); 00094 _STLP_STATIC_CONSTANT(bool, traps = false); 00095 _STLP_STATIC_CONSTANT(bool, tinyness_before = false); 00096 00097 static __number _STLP_CALL epsilon() _STLP_NOTHROW { return __number(); } 00098 static __number _STLP_CALL round_error() _STLP_NOTHROW { return __number(); } 00099 00100 static __number _STLP_CALL infinity() _STLP_NOTHROW { return __number(); } 00101 static __number _STLP_CALL quiet_NaN() _STLP_NOTHROW { return __number(); } 00102 static __number _STLP_CALL signaling_NaN() _STLP_NOTHROW { return __number(); } 00103 static __number _STLP_CALL denorm_min() _STLP_NOTHROW { return __number(); } 00104 }; 00105 00106 // Base class for integers. 00107 00108 #ifdef _STLP_LIMITED_DEFAULT_TEMPLATES 00109 # ifdef _STLP_LONG_LONG 00110 # define _STLP_LIMITS_MIN_TYPE _STLP_LONG_LONG 00111 # define _STLP_LIMITS_MAX_TYPE unsigned _STLP_LONG_LONG 00112 # else 00113 # define _STLP_LIMITS_MIN_TYPE long 00114 # define _STLP_LIMITS_MAX_TYPE unsigned long 00115 # endif 00116 #else 00117 # define _STLP_LIMITS_MIN_TYPE _Int 00118 # define _STLP_LIMITS_MAX_TYPE _Int 00119 #endif /* _STLP_LIMITED_DEFAULT_TEMPLATES */ 00120 00121 template <class _Int, 00122 _STLP_LIMITS_MIN_TYPE __imin, 00123 _STLP_LIMITS_MAX_TYPE __imax, 00124 int __idigits, bool __ismod> 00125 class _Integer_limits : public _Numeric_limits_base<_Int> { 00126 public: 00127 00128 static _Int _STLP_CALL min () _STLP_NOTHROW { return (_Int)__imin; } 00129 static _Int _STLP_CALL max () _STLP_NOTHROW { return (_Int)__imax; } 00130 00131 _STLP_STATIC_CONSTANT(int, digits = (__idigits < 0) ? ((int)((sizeof(_Int) * (CHAR_BIT))) - ((__imin == 0) ? 0 : 1)) : (__idigits)); 00132 _STLP_STATIC_CONSTANT(int, digits10 = (digits * 301UL) / 1000); 00133 _STLP_STATIC_CONSTANT(int, radix = 2); 00134 _STLP_STATIC_CONSTANT(bool, is_specialized = true); 00135 _STLP_STATIC_CONSTANT(bool, is_signed = (__imin != 0)); 00136 _STLP_STATIC_CONSTANT(bool, is_integer = true); 00137 _STLP_STATIC_CONSTANT(bool, is_exact = true); 00138 _STLP_STATIC_CONSTANT(bool, is_bounded = true); 00139 _STLP_STATIC_CONSTANT(bool, is_modulo = __ismod); 00140 }; 00141 00142 // Base class for floating-point numbers. 00143 template <class __number, 00144 int __Digits, int __Digits10, 00145 int __MinExp, int __MaxExp, 00146 int __MinExp10, int __MaxExp10, 00147 bool __IsIEC559, 00148 float_denorm_style __DenormStyle, 00149 float_round_style __RoundStyle> 00150 class _Floating_limits : public _Numeric_limits_base<__number> { 00151 public: 00152 00153 _STLP_STATIC_CONSTANT(int, digits = __Digits); 00154 _STLP_STATIC_CONSTANT(int, digits10 = __Digits10); 00155 _STLP_STATIC_CONSTANT(int, radix = FLT_RADIX); 00156 _STLP_STATIC_CONSTANT(int, min_exponent = __MinExp); 00157 _STLP_STATIC_CONSTANT(int, max_exponent = __MaxExp); 00158 _STLP_STATIC_CONSTANT(int, min_exponent10 = __MinExp10); 00159 _STLP_STATIC_CONSTANT(int, max_exponent10 = __MaxExp10); 00160 00161 _STLP_STATIC_CONSTANT(float_denorm_style, has_denorm = __DenormStyle); 00162 _STLP_STATIC_CONSTANT(float_round_style, round_style = __RoundStyle); 00163 00164 _STLP_STATIC_CONSTANT(bool, is_specialized = true); 00165 _STLP_STATIC_CONSTANT(bool, is_signed = true); 00166 00167 _STLP_STATIC_CONSTANT(bool, has_infinity = true); 00168 #if (!defined (_STLP_MSVC) || (_STLP_MSVC > 1300)) && \ 00169 (!defined (__BORLANDC__) || (__BORLANDC__ >= 0x590)) && \ 00170 (!defined (_CRAY) || defined (_CRAYIEEE)) 00171 _STLP_STATIC_CONSTANT(bool, has_quiet_NaN = true); 00172 _STLP_STATIC_CONSTANT(bool, has_signaling_NaN = true); 00173 #else 00174 _STLP_STATIC_CONSTANT(bool, has_quiet_NaN = false); 00175 _STLP_STATIC_CONSTANT(bool, has_signaling_NaN = false); 00176 #endif 00177 00178 _STLP_STATIC_CONSTANT(bool, is_iec559 = __IsIEC559 && has_infinity && has_quiet_NaN && has_signaling_NaN && (has_denorm == denorm_present)); 00179 _STLP_STATIC_CONSTANT(bool, has_denorm_loss = false); 00180 _STLP_STATIC_CONSTANT(bool, is_bounded = true); 00181 _STLP_STATIC_CONSTANT(bool, traps = true); 00182 _STLP_STATIC_CONSTANT(bool, tinyness_before = false); 00183 }; 00184 00185 _STLP_MOVE_TO_STD_NAMESPACE 00186 00187 // Class numeric_limits 00188 00189 // The unspecialized class. 00190 00191 template<class _Tp> 00192 class numeric_limits : public _STLP_PRIV _Numeric_limits_base<_Tp> {}; 00193 00194 // Specializations for all built-in integral types. 00195 00196 #if !defined (_STLP_NO_BOOL) 00197 _STLP_TEMPLATE_NULL 00198 class numeric_limits<bool> 00199 : public _STLP_PRIV _Integer_limits<bool, false, true, 1, false> 00200 {}; 00201 #endif /* _STLP_NO_BOOL */ 00202 00203 _STLP_TEMPLATE_NULL 00204 class numeric_limits<char> 00205 : public _STLP_PRIV _Integer_limits<char, CHAR_MIN, CHAR_MAX, -1, true> 00206 {}; 00207 00208 #if !defined (_STLP_NO_SIGNED_BUILTINS) 00209 _STLP_TEMPLATE_NULL 00210 class numeric_limits<signed char> 00211 : public _STLP_PRIV _Integer_limits<signed char, SCHAR_MIN, SCHAR_MAX, -1, true> 00212 {}; 00213 #endif 00214 00215 _STLP_TEMPLATE_NULL 00216 class numeric_limits<unsigned char> 00217 : public _STLP_PRIV _Integer_limits<unsigned char, 0, UCHAR_MAX, -1, true> 00218 {}; 00219 00220 #if !(defined (_STLP_NO_WCHAR_T) || defined (_STLP_WCHAR_T_IS_USHORT)) 00221 00222 _STLP_TEMPLATE_NULL 00223 class numeric_limits<wchar_t> 00224 : public _STLP_PRIV _Integer_limits<wchar_t, WCHAR_MIN, WCHAR_MAX, -1, true> 00225 {}; 00226 00227 #endif 00228 00229 _STLP_TEMPLATE_NULL 00230 class numeric_limits<short> 00231 : public _STLP_PRIV _Integer_limits<short, SHRT_MIN, SHRT_MAX, -1, true> 00232 {}; 00233 00234 _STLP_TEMPLATE_NULL 00235 class numeric_limits<unsigned short> 00236 : public _STLP_PRIV _Integer_limits<unsigned short, 0, USHRT_MAX, -1, true> 00237 {}; 00238 00239 #if defined (__xlC__) && (__xlC__ == 0x500) 00240 # undef INT_MIN 00241 # define INT_MIN -2147483648 00242 #endif 00243 00244 _STLP_TEMPLATE_NULL 00245 class numeric_limits<int> 00246 : public _STLP_PRIV _Integer_limits<int, INT_MIN, INT_MAX, -1, true> 00247 {}; 00248 00249 _STLP_TEMPLATE_NULL 00250 class numeric_limits<unsigned int> 00251 : public _STLP_PRIV _Integer_limits<unsigned int, 0, UINT_MAX, -1, true> 00252 {}; 00253 00254 _STLP_TEMPLATE_NULL 00255 class numeric_limits<long> 00256 : public _STLP_PRIV _Integer_limits<long, LONG_MIN, LONG_MAX, -1, true> 00257 {}; 00258 00259 _STLP_TEMPLATE_NULL 00260 class numeric_limits<unsigned long> 00261 : public _STLP_PRIV _Integer_limits<unsigned long, 0, ULONG_MAX, -1, true> 00262 {}; 00263 00264 #if defined (_STLP_LONG_LONG) 00265 00266 # if defined (_STLP_MSVC) || defined (__BORLANDC__) 00267 # define LONGLONG_MAX 0x7fffffffffffffffi64 00268 # define LONGLONG_MIN (-LONGLONG_MAX-1i64) 00269 # define ULONGLONG_MAX 0xffffffffffffffffUi64 00270 # else 00271 # ifndef LONGLONG_MAX 00272 # define LONGLONG_MAX 0x7fffffffffffffffLL 00273 # endif 00274 # ifndef LONGLONG_MIN 00275 # define LONGLONG_MIN (-LONGLONG_MAX-1LL) 00276 # endif 00277 # ifndef ULONGLONG_MAX 00278 # define ULONGLONG_MAX 0xffffffffffffffffULL 00279 # endif 00280 # endif 00281 00282 # if !defined (__GNUC__) || (__GNUC__ == 2 && __GNUC_MINOR__ <= 96) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 3) 00283 00284 _STLP_TEMPLATE_NULL 00285 class numeric_limits<_STLP_LONG_LONG> 00286 : public _STLP_PRIV _Integer_limits<_STLP_LONG_LONG, LONGLONG_MIN, LONGLONG_MAX, -1, true> 00287 {}; 00288 00289 _STLP_TEMPLATE_NULL 00290 class numeric_limits<unsigned _STLP_LONG_LONG> 00291 : public _STLP_PRIV _Integer_limits<unsigned _STLP_LONG_LONG, 0, ULONGLONG_MAX, -1, true> 00292 {}; 00293 # else /* gcc 2.97 (after 2000-11-01), 2.98, 3.0 */ 00294 /* 00295 newest gcc has new mangling scheme, that has problem 00296 with generating name [instantiated] of template specialization like 00297 _Integer_limits<_STLP_LONG_LONG, LONGLONG_MIN, LONGLONG_MAX, -1, true> 00298 ~~~~~~~~~~~~ ~~~~~~~~~~~~ 00299 Below is code that solve this problem. 00300 - ptr 00301 */ 00302 _STLP_TEMPLATE_NULL 00303 class numeric_limits<_STLP_LONG_LONG> 00304 : public _STLP_PRIV _Numeric_limits_base<_STLP_LONG_LONG> { 00305 public: 00306 00307 static _STLP_LONG_LONG (_STLP_CALL min) () _STLP_NOTHROW { return LONGLONG_MIN; } 00308 static _STLP_LONG_LONG (_STLP_CALL max) () _STLP_NOTHROW { return LONGLONG_MAX; } 00309 00310 _STLP_STATIC_CONSTANT(int, digits = ((int)((sizeof(_STLP_LONG_LONG) * (CHAR_BIT))) - 1)); 00311 _STLP_STATIC_CONSTANT(int, digits10 = (digits * 301UL) / 1000); 00312 _STLP_STATIC_CONSTANT(int, radix = 2); 00313 _STLP_STATIC_CONSTANT(bool, is_specialized = true); 00314 _STLP_STATIC_CONSTANT(bool, is_signed = true); 00315 _STLP_STATIC_CONSTANT(bool, is_integer = true); 00316 _STLP_STATIC_CONSTANT(bool, is_exact = true); 00317 _STLP_STATIC_CONSTANT(bool, is_bounded = true); 00318 _STLP_STATIC_CONSTANT(bool, is_modulo = true); 00319 }; 00320 00321 _STLP_TEMPLATE_NULL 00322 class numeric_limits<unsigned _STLP_LONG_LONG> 00323 : public _STLP_PRIV _Numeric_limits_base<unsigned _STLP_LONG_LONG> { 00324 public: 00325 00326 static unsigned _STLP_LONG_LONG (_STLP_CALL min) () _STLP_NOTHROW { return 0ULL; } 00327 static unsigned _STLP_LONG_LONG (_STLP_CALL max) () _STLP_NOTHROW { return ULONGLONG_MAX; } 00328 00329 _STLP_STATIC_CONSTANT(int, digits = ((int)((sizeof(unsigned _STLP_LONG_LONG) * (CHAR_BIT))))); 00330 _STLP_STATIC_CONSTANT(int, digits10 = (digits * 301UL) / 1000); 00331 _STLP_STATIC_CONSTANT(int, radix = 2); 00332 _STLP_STATIC_CONSTANT(bool, is_specialized = true); 00333 _STLP_STATIC_CONSTANT(bool, is_signed = false); 00334 _STLP_STATIC_CONSTANT(bool, is_integer = true); 00335 _STLP_STATIC_CONSTANT(bool, is_exact = true); 00336 _STLP_STATIC_CONSTANT(bool, is_bounded = true); 00337 _STLP_STATIC_CONSTANT(bool, is_modulo = true); 00338 }; 00339 00340 # endif /* __GNUC__ > 2000-11-01 */ 00341 00342 #endif /* _STLP_LONG_LONG */ 00343 00344 _STLP_MOVE_TO_PRIV_NAMESPACE 00345 00346 // Specializations for all built-in floating-point types. 00347 template <class __dummy> 00348 class _LimG { 00349 public: 00350 static float _STLP_CALL get_F_inf(); 00351 static float _STLP_CALL get_F_qNaN(); 00352 static float _STLP_CALL get_F_sNaN(); 00353 static float _STLP_CALL get_F_denormMin(); 00354 static double _STLP_CALL get_D_inf(); 00355 static double _STLP_CALL get_D_qNaN(); 00356 static double _STLP_CALL get_D_sNaN(); 00357 static double _STLP_CALL get_D_denormMin(); 00358 00359 #if !defined (_STLP_NO_LONG_DOUBLE) 00360 static long double _STLP_CALL get_LD_inf(); 00361 static long double _STLP_CALL get_LD_qNaN(); 00362 static long double _STLP_CALL get_LD_sNaN(); 00363 static long double _STLP_CALL get_LD_denormMin(); 00364 #endif 00365 }; 00366 00367 #if defined (_STLP_USE_TEMPLATE_EXPORT) 00368 _STLP_EXPORT_TEMPLATE_CLASS _LimG<bool>; 00369 #endif 00370 00371 #if defined (__GNUC__) 00372 # if defined (__FLT_DENORM_MIN__) 00373 # define _STLP_FLT_DENORM_MIN __FLT_DENORM_MIN__ 00374 # else 00375 # define _STLP_FLT_DENORM_STYLE denorm_absent 00376 # endif 00377 # if defined (__DBL_DENORM_MIN__) 00378 # define _STLP_DBL_DENORM_MIN __DBL_DENORM_MIN__ 00379 # else 00380 # define _STLP_DBL_DENORM_STYLE denorm_absent 00381 # endif 00382 # if defined (__LDBL_DENORM_MIN__) 00383 # define _STLP_LDBL_DENORM_MIN __LDBL_DENORM_MIN__ 00384 # else 00385 # define _STLP_LDBL_DENORM_STYLE denorm_absent 00386 # endif 00387 #endif 00388 00389 /* If compiler do not expose thanks to some macro its status regarding 00390 * denormalized floating point numbers, we consider that denormalization 00391 * is present. Unit tests will tell us if compiler do not support them. */ 00392 #if !defined (_STLP_FLT_DENORM_STYLE) 00393 # define _STLP_FLT_DENORM_STYLE denorm_present 00394 #endif 00395 00396 #if !defined (_STLP_DBL_DENORM_STYLE) 00397 # define _STLP_DBL_DENORM_STYLE denorm_present 00398 #endif 00399 00400 #if !defined (_STLP_LDBL_DENORM_STYLE) 00401 # define _STLP_LDBL_DENORM_STYLE denorm_present 00402 #endif 00403 00404 _STLP_MOVE_TO_STD_NAMESPACE 00405 00406 _STLP_TEMPLATE_NULL 00407 class numeric_limits<float> 00408 : public _STLP_PRIV _Floating_limits<float, 00409 FLT_MANT_DIG, // Binary digits of precision 00410 FLT_DIG, // Decimal digits of precision 00411 FLT_MIN_EXP, // Minimum exponent 00412 FLT_MAX_EXP, // Maximum exponent 00413 FLT_MIN_10_EXP, // Minimum base 10 exponent 00414 FLT_MAX_10_EXP, // Maximum base 10 exponent 00415 true, 00416 _STLP_FLT_DENORM_STYLE, 00417 round_to_nearest> { 00418 public: 00419 static float (_STLP_CALL min) () _STLP_NOTHROW { return FLT_MIN; } 00420 static float _STLP_CALL denorm_min() _STLP_NOTHROW 00421 #if defined (_STLP_FLT_DENORM_MIN) 00422 { return _STLP_FLT_DENORM_MIN; } 00423 #else 00424 { return _STLP_FLT_DENORM_STYLE ? _STLP_PRIV _LimG<bool>::get_F_denormMin() : FLT_MIN; } 00425 #endif 00426 static float (_STLP_CALL max) () _STLP_NOTHROW { return FLT_MAX; } 00427 static float _STLP_CALL epsilon() _STLP_NOTHROW { return FLT_EPSILON; } 00428 static float _STLP_CALL round_error() _STLP_NOTHROW { return 0.5f; } // Units: ulps. 00429 static float _STLP_CALL infinity() _STLP_NOTHROW { return _STLP_PRIV _LimG<bool>::get_F_inf(); } 00430 static float _STLP_CALL quiet_NaN() _STLP_NOTHROW { return _STLP_PRIV _LimG<bool>::get_F_qNaN(); } 00431 static float _STLP_CALL signaling_NaN() _STLP_NOTHROW { return _STLP_PRIV _LimG<bool>::get_F_sNaN(); } 00432 }; 00433 00434 #undef _STLP_FLT_DENORM_MIN 00435 #undef _STLP_FLT_DNORM_STYLE 00436 00437 _STLP_TEMPLATE_NULL 00438 class numeric_limits<double> 00439 : public _STLP_PRIV _Floating_limits<double, 00440 DBL_MANT_DIG, // Binary digits of precision 00441 DBL_DIG, // Decimal digits of precision 00442 DBL_MIN_EXP, // Minimum exponent 00443 DBL_MAX_EXP, // Maximum exponent 00444 DBL_MIN_10_EXP, // Minimum base 10 exponent 00445 DBL_MAX_10_EXP, // Maximum base 10 exponent 00446 true, 00447 _STLP_DBL_DENORM_STYLE, 00448 round_to_nearest> { 00449 public: 00450 static double (_STLP_CALL min)() _STLP_NOTHROW { return DBL_MIN; } 00451 static double _STLP_CALL denorm_min() _STLP_NOTHROW 00452 #if defined (_STLP_DBL_DENORM_MIN) 00453 { return _STLP_DBL_DENORM_MIN; } 00454 #else 00455 { return _STLP_DBL_DENORM_STYLE ? _STLP_PRIV _LimG<bool>::get_D_denormMin() : DBL_MIN; } 00456 #endif 00457 static double (_STLP_CALL max)() _STLP_NOTHROW { return DBL_MAX; } 00458 static double _STLP_CALL epsilon() _STLP_NOTHROW { return DBL_EPSILON; } 00459 static double _STLP_CALL round_error() _STLP_NOTHROW { return 0.5; } // Units: ulps. 00460 static double _STLP_CALL infinity() _STLP_NOTHROW { return _STLP_PRIV _LimG<bool>::get_D_inf(); } 00461 static double _STLP_CALL quiet_NaN() _STLP_NOTHROW { return _STLP_PRIV _LimG<bool>::get_D_qNaN(); } 00462 static double _STLP_CALL signaling_NaN() _STLP_NOTHROW { return _STLP_PRIV _LimG<bool>::get_D_sNaN(); } 00463 }; 00464 00465 #if !defined (_STLP_NO_LONG_DOUBLE) 00466 00467 _STLP_TEMPLATE_NULL 00468 class numeric_limits<long double> 00469 : public _STLP_PRIV _Floating_limits<long double, 00470 LDBL_MANT_DIG, // Binary digits of precision 00471 LDBL_DIG, // Decimal digits of precision 00472 LDBL_MIN_EXP, // Minimum exponent 00473 LDBL_MAX_EXP, // Maximum exponent 00474 LDBL_MIN_10_EXP,// Minimum base 10 exponent 00475 LDBL_MAX_10_EXP,// Maximum base 10 exponent 00476 false, // do not conform to iec559 00477 _STLP_LDBL_DENORM_STYLE, 00478 round_to_nearest> { 00479 public: 00480 static long double (_STLP_CALL min) () _STLP_NOTHROW { return LDBL_MIN; } 00481 static long double _STLP_CALL denorm_min() _STLP_NOTHROW 00482 #if defined (_STLP_LDBL_DENORM_MIN) 00483 { return _STLP_LDBL_DENORM_MIN; } 00484 #else 00485 { return _STLP_LDBL_DENORM_STYLE ? _STLP_PRIV _LimG<bool>::get_LD_denormMin() : LDBL_MIN; } 00486 #endif 00487 _STLP_STATIC_CONSTANT(bool, is_iec559 = false); 00488 static long double (_STLP_CALL max) () _STLP_NOTHROW { return LDBL_MAX; } 00489 static long double _STLP_CALL epsilon() _STLP_NOTHROW { return LDBL_EPSILON; } 00490 static long double _STLP_CALL round_error() _STLP_NOTHROW { return 0.5l; } 00491 static long double _STLP_CALL infinity() _STLP_NOTHROW 00492 //For MSVC, long double is nothing more than an alias for double. 00493 #if !defined (_STLP_MSVC) 00494 { return _STLP_PRIV _LimG<bool>::get_LD_inf(); } 00495 #else 00496 { return _STLP_PRIV _LimG<bool>::get_D_inf(); } 00497 #endif 00498 static long double _STLP_CALL quiet_NaN() _STLP_NOTHROW 00499 #if !defined (_STLP_MSVC) 00500 { return _STLP_PRIV _LimG<bool>::get_LD_qNaN(); } 00501 #else 00502 { return _STLP_PRIV _LimG<bool>::get_D_qNaN(); } 00503 #endif 00504 static long double _STLP_CALL signaling_NaN() _STLP_NOTHROW 00505 #if !defined (_STLP_MSVC) 00506 { return _STLP_PRIV _LimG<bool>::get_LD_sNaN(); } 00507 #else 00508 { return _STLP_PRIV _LimG<bool>::get_D_sNaN(); } 00509 #endif 00510 }; 00511 00512 #endif 00513 00514 // We write special values (Inf and NaN) as bit patterns and 00515 // cast the the appropriate floating-point types. 00516 _STLP_END_NAMESPACE 00517 00518 #if !defined (_STLP_LINK_TIME_INSTANTIATION) 00519 # include <stl/_limits.c> 00520 #endif 00521 00522 #endif 00523 00524 // Local Variables: 00525 // mode:C++ 00526 // End: Generated on Fri May 25 2012 04:27:45 for ReactOS by
1.7.6.1
|