?? limits
字號:
return *reinterpret_cast<const __number*>(&_S_inf); } static __number quiet_NaN() __STL_NOTHROW { static const unsigned int _S_nan[sizeof(__number) / sizeof(int)] = { __QNaNWord }; return *reinterpret_cast<const __number*>(&_S_nan); } static __number signaling_NaN() __STL_NOTHROW { static const unsigned int _S_nan[sizeof(__number) / sizeof(int)] = { __SNaNWord }; return *reinterpret_cast<const __number*>(&_S_nan); } __STL_DECLARE_LIMITS_MEMBER(bool, is_iec559, __IsIEC559); __STL_DECLARE_LIMITS_MEMBER(bool, is_bounded, true); __STL_DECLARE_LIMITS_MEMBER(bool, traps, true); __STL_DECLARE_LIMITS_MEMBER(bool, tinyness_before, false); __STL_DECLARE_LIMITS_MEMBER(float_round_style, round_style, __RoundStyle);};#ifdef __STL_STATIC_CONST_INIT_BUG# define __STL_DEFINE_FLOAT_LIMITS_MEMBER(__type, __mem)#else /* __STL_STATIC_CONST_INIT_BUG */# define __STL_DEFINE_FLOAT_LIMITS_MEMBER(__type, __mem) \ template <class __Num, int __Dig, int __Dig10, \ int __MnX, int __MxX, int __MnX10, int __MxX10, \ unsigned int __Inf, unsigned int __QNaN, unsigned int __SNaN, \ bool __IsIEEE, float_round_style __Sty> \ const __type _Floating_limits<__Num, __Dig, __Dig10, \ __MnX, __MxX, __MnX10, __MxX10, \ __Inf, __QNaN, __SNaN,__IsIEEE, __Sty>:: __mem#endif /* __STL_STATIC_CONST_INIT_BUG */__STL_DEFINE_FLOAT_LIMITS_MEMBER(bool, is_specialized); __STL_DEFINE_FLOAT_LIMITS_MEMBER(int, digits); __STL_DEFINE_FLOAT_LIMITS_MEMBER(int, digits10); __STL_DEFINE_FLOAT_LIMITS_MEMBER(bool, is_signed); __STL_DEFINE_FLOAT_LIMITS_MEMBER(int, radix); __STL_DEFINE_FLOAT_LIMITS_MEMBER(int, min_exponent); __STL_DEFINE_FLOAT_LIMITS_MEMBER(int, max_exponent); __STL_DEFINE_FLOAT_LIMITS_MEMBER(int, min_exponent10); __STL_DEFINE_FLOAT_LIMITS_MEMBER(int, max_exponent10); __STL_DEFINE_FLOAT_LIMITS_MEMBER(bool, has_infinity);__STL_DEFINE_FLOAT_LIMITS_MEMBER(bool, has_quiet_NaN);__STL_DEFINE_FLOAT_LIMITS_MEMBER(bool, has_signaling_NaN);__STL_DEFINE_FLOAT_LIMITS_MEMBER(float_denorm_style, has_denorm);__STL_DEFINE_FLOAT_LIMITS_MEMBER(bool, has_denorm_loss);__STL_DEFINE_FLOAT_LIMITS_MEMBER(bool, is_iec559);__STL_DEFINE_FLOAT_LIMITS_MEMBER(bool, is_bounded);__STL_DEFINE_FLOAT_LIMITS_MEMBER(bool, traps);__STL_DEFINE_FLOAT_LIMITS_MEMBER(bool, tinyness_before);__STL_DEFINE_FLOAT_LIMITS_MEMBER(float_round_style, round_style);#undef __STL_DECLARE_NUMERIC_LIMITS_MEMBER#undef __STL_DEFINE_NUMERIC_BASE_MEMBER#undef __STL_DEFINE_INTEGER_LIMITS_MEMBER#undef __STL_DEFINE_FLOAT_LIMITS_MEMBER// Class numeric_limits// The unspecialized class.template<class T> class numeric_limits : public _Numeric_limits_base<T> {};// Specializations for all built-in integral types.#ifndef __STL_NO_BOOL__STL_TEMPLATE_NULLclass numeric_limits<bool> : public _Integer_limits<bool, false, true, 0>{};#endif /* __STL_NO_BOOL */__STL_TEMPLATE_NULLclass numeric_limits<char> : public _Integer_limits<char, CHAR_MIN, CHAR_MAX>{};__STL_TEMPLATE_NULLclass numeric_limits<signed char> : public _Integer_limits<signed char, SCHAR_MIN, SCHAR_MAX>{};__STL_TEMPLATE_NULLclass numeric_limits<unsigned char> : public _Integer_limits<unsigned char, 0, UCHAR_MAX>{};#ifdef __STL_HAS_WCHAR_T__STL_TEMPLATE_NULLclass numeric_limits<wchar_t> : public _Integer_limits<wchar_t, INT_MIN, INT_MAX>{};#endif__STL_TEMPLATE_NULLclass numeric_limits<short> : public _Integer_limits<short, SHRT_MIN, SHRT_MAX>{};__STL_TEMPLATE_NULLclass numeric_limits<unsigned short> : public _Integer_limits<unsigned short, 0, USHRT_MAX>{};__STL_TEMPLATE_NULLclass numeric_limits<int> : public _Integer_limits<int, INT_MIN, INT_MAX>{};__STL_TEMPLATE_NULLclass numeric_limits<unsigned int> : public _Integer_limits<unsigned int, 0, UINT_MAX>{};__STL_TEMPLATE_NULLclass numeric_limits<long> : public _Integer_limits<long, LONG_MIN, LONG_MAX>{};__STL_TEMPLATE_NULLclass numeric_limits<unsigned long> : public _Integer_limits<unsigned long, 0, ULONG_MAX>{};#ifdef __STL_LONG_LONG// Some compilers have long long, but don't define the// LONGLONG_MIN and LONGLONG_MAX macros in limits.h. This// assumes that long long is 64 bits.#if !defined(LONGLONG_MIN) && !defined(LONGLONG_MAX) \ && !defined(ULONGLONG_MAX)#define ULONGLONG_MAX 0xffffffffffffffffLLU#define LONGLONG_MAX 0x7fffffffffffffffLL#define LONGLONG_MIN (-LONGLONG_MAX - 1)#endif__STL_TEMPLATE_NULLclass numeric_limits<long long> : public _Integer_limits<long long, LONGLONG_MIN, LONGLONG_MAX>{};__STL_TEMPLATE_NULLclass numeric_limits<unsigned long long> : public _Integer_limits<unsigned long long, 0, ULONGLONG_MAX>{};#endif /* __STL_LONG_LONG */// Specializations for all built-in floating-point type.__STL_TEMPLATE_NULL class numeric_limits<float> : public _Floating_limits<float, FLT_MANT_DIG, // Binary digits of precision FLT_DIG, // Decimal digits of precision FLT_MIN_EXP, // Minimum exponent FLT_MAX_EXP, // Maximum exponent FLT_MIN_10_EXP, // Minimum base 10 exponent FLT_MAX_10_EXP, // Maximum base 10 exponent 0x7f800000u, // First word of +infinity 0x7f810000u, // First word of quiet NaN 0x7fc10000u, // First word of signaling NaN true, // conforms to iec559 round_to_nearest>{public: static float min() __STL_NOTHROW { return FLT_MIN; } static float denorm_min() __STL_NOTHROW { return FLT_MIN; } static float max() __STL_NOTHROW { return FLT_MAX; } static float epsilon() __STL_NOTHROW { return FLT_EPSILON; } static float round_error() __STL_NOTHROW { return 0.5f; } // Units: ulps.};__STL_TEMPLATE_NULL class numeric_limits<double> : public _Floating_limits<double, DBL_MANT_DIG, // Binary digits of precision DBL_DIG, // Decimal digits of precision DBL_MIN_EXP, // Minimum exponent DBL_MAX_EXP, // Maximum exponent DBL_MIN_10_EXP, // Minimum base 10 exponent DBL_MAX_10_EXP, // Maximum base 10 exponent 0x7ff00000u, // First word of +infinity 0x7ff10000u, // First word of quiet NaN 0x7ff90000u, // First word of signaling NaN true, // conforms to iec559 round_to_nearest>{public: static double min() __STL_NOTHROW { return DBL_MIN; } static double denorm_min() __STL_NOTHROW { return DBL_MIN; } static double max() __STL_NOTHROW { return DBL_MAX; } static double epsilon() __STL_NOTHROW { return DBL_EPSILON; } static double round_error() __STL_NOTHROW { return 0.5; } // Units: ulps.};__STL_TEMPLATE_NULL class numeric_limits<long double> : public _Floating_limits<long double, LDBL_MANT_DIG, // Binary digits of precision LDBL_DIG, // Decimal digits of precision LDBL_MIN_EXP, // Minimum exponent LDBL_MAX_EXP, // Maximum exponent LDBL_MIN_10_EXP,// Minimum base 10 exponent LDBL_MAX_10_EXP,// Maximum base 10 exponent 0x7ff00000u, // First word of +infinity 0x7ff10000u, // First word of quiet NaN 0x7ff90000u, // First word of signaling NaN false, // Doesn't conform to iec559 round_to_nearest>{public: static long double min() __STL_NOTHROW { return LDBL_MIN; } static long double denorm_min() __STL_NOTHROW { return LDBL_MIN; } static long double max() __STL_NOTHROW { return LDBL_MAX; } static long double epsilon() __STL_NOTHROW { return LDBL_EPSILON; } static long double round_error() __STL_NOTHROW { return 4; } // Units: ulps.};__STL_END_NAMESPACE#endif /* __SGI_CPP_LIMITS */// Local Variables:// mode:C++// End:
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -