Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 1 | // -*- C++ -*- |
| 2 | //===---------------------------- limits ----------------------------------===// |
| 3 | // |
Howard Hinnant | c566dc3 | 2010-05-11 21:36:01 +0000 | [diff] [blame] | 4 | // The LLVM Compiler Infrastructure |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 5 | // |
Howard Hinnant | ee11c31 | 2010-11-16 22:09:02 +0000 | [diff] [blame] | 6 | // This file is dual licensed under the MIT and the University of Illinois Open |
| 7 | // Source Licenses. See LICENSE.TXT for details. |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 8 | // |
| 9 | //===----------------------------------------------------------------------===// |
| 10 | |
| 11 | #ifndef _LIBCPP_LIMITS |
| 12 | #define _LIBCPP_LIMITS |
| 13 | |
| 14 | /* |
| 15 | limits synopsis |
| 16 | |
| 17 | namespace std |
| 18 | { |
| 19 | |
| 20 | template<class T> |
| 21 | class numeric_limits |
| 22 | { |
| 23 | public: |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 24 | static constexpr bool is_specialized = false; |
| 25 | static constexpr T min() noexcept; |
| 26 | static constexpr T max() noexcept; |
| 27 | static constexpr T lowest() noexcept; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 28 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 29 | static constexpr int digits = 0; |
| 30 | static constexpr int digits10 = 0; |
| 31 | static constexpr int max_digits10 = 0; |
| 32 | static constexpr bool is_signed = false; |
| 33 | static constexpr bool is_integer = false; |
| 34 | static constexpr bool is_exact = false; |
| 35 | static constexpr int radix = 0; |
| 36 | static constexpr T epsilon() noexcept; |
| 37 | static constexpr T round_error() noexcept; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 38 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 39 | static constexpr int min_exponent = 0; |
| 40 | static constexpr int min_exponent10 = 0; |
| 41 | static constexpr int max_exponent = 0; |
| 42 | static constexpr int max_exponent10 = 0; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 43 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 44 | static constexpr bool has_infinity = false; |
| 45 | static constexpr bool has_quiet_NaN = false; |
| 46 | static constexpr bool has_signaling_NaN = false; |
| 47 | static constexpr float_denorm_style has_denorm = denorm_absent; |
| 48 | static constexpr bool has_denorm_loss = false; |
| 49 | static constexpr T infinity() noexcept; |
| 50 | static constexpr T quiet_NaN() noexcept; |
| 51 | static constexpr T signaling_NaN() noexcept; |
| 52 | static constexpr T denorm_min() noexcept; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 53 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 54 | static constexpr bool is_iec559 = false; |
| 55 | static constexpr bool is_bounded = false; |
| 56 | static constexpr bool is_modulo = false; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 57 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 58 | static constexpr bool traps = false; |
| 59 | static constexpr bool tinyness_before = false; |
| 60 | static constexpr float_round_style round_style = round_toward_zero; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 61 | }; |
| 62 | |
| 63 | enum float_round_style |
| 64 | { |
| 65 | round_indeterminate = -1, |
| 66 | round_toward_zero = 0, |
| 67 | round_to_nearest = 1, |
| 68 | round_toward_infinity = 2, |
| 69 | round_toward_neg_infinity = 3 |
| 70 | }; |
| 71 | |
| 72 | enum float_denorm_style |
| 73 | { |
| 74 | denorm_indeterminate = -1, |
| 75 | denorm_absent = 0, |
| 76 | denorm_present = 1 |
| 77 | }; |
| 78 | |
| 79 | template<> class numeric_limits<cv bool>; |
| 80 | |
| 81 | template<> class numeric_limits<cv char>; |
| 82 | template<> class numeric_limits<cv signed char>; |
| 83 | template<> class numeric_limits<cv unsigned char>; |
| 84 | template<> class numeric_limits<cv wchar_t>; |
| 85 | template<> class numeric_limits<cv char16_t>; |
| 86 | template<> class numeric_limits<cv char32_t>; |
| 87 | |
| 88 | template<> class numeric_limits<cv short>; |
| 89 | template<> class numeric_limits<cv int>; |
| 90 | template<> class numeric_limits<cv long>; |
| 91 | template<> class numeric_limits<cv long long>; |
| 92 | template<> class numeric_limits<cv unsigned short>; |
| 93 | template<> class numeric_limits<cv unsigned int>; |
| 94 | template<> class numeric_limits<cv unsigned long>; |
| 95 | template<> class numeric_limits<cv unsigned long long>; |
| 96 | |
| 97 | template<> class numeric_limits<cv float>; |
| 98 | template<> class numeric_limits<cv double>; |
| 99 | template<> class numeric_limits<cv long double>; |
| 100 | |
| 101 | } // std |
| 102 | |
| 103 | */ |
| 104 | |
Howard Hinnant | aaaa52b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 105 | #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 106 | #pragma GCC system_header |
Howard Hinnant | aaaa52b | 2011-10-17 20:05:10 +0000 | [diff] [blame] | 107 | #endif |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 108 | |
| 109 | #include <__config> |
| 110 | #include <type_traits> |
| 111 | |
Howard Hinnant | c5a5fbd | 2011-11-29 16:45:27 +0000 | [diff] [blame] | 112 | #include <__undef_min_max> |
| 113 | |
Howard Hinnant | 13d8bc1 | 2013-08-01 18:17:34 +0000 | [diff] [blame] | 114 | #if defined(_LIBCPP_MSVCRT) |
Howard Hinnant | bf07402 | 2011-10-22 20:59:45 +0000 | [diff] [blame] | 115 | #include "support/win32/limits_win32.h" |
Howard Hinnant | 13d8bc1 | 2013-08-01 18:17:34 +0000 | [diff] [blame] | 116 | #endif // _LIBCPP_MSVCRT |
Howard Hinnant | bf07402 | 2011-10-22 20:59:45 +0000 | [diff] [blame] | 117 | |
Howard Hinnant | ea38295 | 2013-08-14 18:00:20 +0000 | [diff] [blame] | 118 | #if defined(__IBMCPP__) |
| 119 | #include "support/ibm/limits.h" |
| 120 | #endif // __IBMCPP__ |
| 121 | |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 122 | _LIBCPP_BEGIN_NAMESPACE_STD |
| 123 | |
| 124 | enum float_round_style |
| 125 | { |
| 126 | round_indeterminate = -1, |
| 127 | round_toward_zero = 0, |
| 128 | round_to_nearest = 1, |
| 129 | round_toward_infinity = 2, |
| 130 | round_toward_neg_infinity = 3 |
| 131 | }; |
| 132 | |
| 133 | enum float_denorm_style |
| 134 | { |
| 135 | denorm_indeterminate = -1, |
| 136 | denorm_absent = 0, |
| 137 | denorm_present = 1 |
| 138 | }; |
| 139 | |
| 140 | template <class _Tp, bool = is_arithmetic<_Tp>::value> |
| 141 | class __libcpp_numeric_limits |
| 142 | { |
| 143 | protected: |
| 144 | typedef _Tp type; |
| 145 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 146 | static _LIBCPP_CONSTEXPR const bool is_specialized = false; |
| 147 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return type();} |
| 148 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return type();} |
| 149 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return type();} |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 150 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 151 | static _LIBCPP_CONSTEXPR const int digits = 0; |
| 152 | static _LIBCPP_CONSTEXPR const int digits10 = 0; |
| 153 | static _LIBCPP_CONSTEXPR const int max_digits10 = 0; |
| 154 | static _LIBCPP_CONSTEXPR const bool is_signed = false; |
| 155 | static _LIBCPP_CONSTEXPR const bool is_integer = false; |
| 156 | static _LIBCPP_CONSTEXPR const bool is_exact = false; |
| 157 | static _LIBCPP_CONSTEXPR const int radix = 0; |
| 158 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return type();} |
| 159 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return type();} |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 160 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 161 | static _LIBCPP_CONSTEXPR const int min_exponent = 0; |
| 162 | static _LIBCPP_CONSTEXPR const int min_exponent10 = 0; |
| 163 | static _LIBCPP_CONSTEXPR const int max_exponent = 0; |
| 164 | static _LIBCPP_CONSTEXPR const int max_exponent10 = 0; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 165 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 166 | static _LIBCPP_CONSTEXPR const bool has_infinity = false; |
| 167 | static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = false; |
| 168 | static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = false; |
| 169 | static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = denorm_absent; |
| 170 | static _LIBCPP_CONSTEXPR const bool has_denorm_loss = false; |
| 171 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return type();} |
| 172 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return type();} |
| 173 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return type();} |
| 174 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return type();} |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 175 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 176 | static _LIBCPP_CONSTEXPR const bool is_iec559 = false; |
| 177 | static _LIBCPP_CONSTEXPR const bool is_bounded = false; |
| 178 | static _LIBCPP_CONSTEXPR const bool is_modulo = false; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 179 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 180 | static _LIBCPP_CONSTEXPR const bool traps = false; |
| 181 | static _LIBCPP_CONSTEXPR const bool tinyness_before = false; |
| 182 | static _LIBCPP_CONSTEXPR const float_round_style round_style = round_toward_zero; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 183 | }; |
| 184 | |
Eric Fiselier | 91ff681 | 2016-11-16 04:45:32 +0000 | [diff] [blame] | 185 | template <class _Tp, int digits, bool _IsSigned> |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 186 | struct __libcpp_compute_min |
| 187 | { |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 188 | static _LIBCPP_CONSTEXPR const _Tp value = _Tp(_Tp(1) << digits); |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 189 | }; |
| 190 | |
| 191 | template <class _Tp, int digits> |
| 192 | struct __libcpp_compute_min<_Tp, digits, false> |
| 193 | { |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 194 | static _LIBCPP_CONSTEXPR const _Tp value = _Tp(0); |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 195 | }; |
| 196 | |
| 197 | template <class _Tp> |
| 198 | class __libcpp_numeric_limits<_Tp, true> |
| 199 | { |
| 200 | protected: |
| 201 | typedef _Tp type; |
| 202 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 203 | static _LIBCPP_CONSTEXPR const bool is_specialized = true; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 204 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 205 | static _LIBCPP_CONSTEXPR const bool is_signed = type(-1) < type(0); |
| 206 | static _LIBCPP_CONSTEXPR const int digits = static_cast<int>(sizeof(type) * __CHAR_BIT__ - is_signed); |
| 207 | static _LIBCPP_CONSTEXPR const int digits10 = digits * 3 / 10; |
| 208 | static _LIBCPP_CONSTEXPR const int max_digits10 = 0; |
| 209 | static _LIBCPP_CONSTEXPR const type __min = __libcpp_compute_min<type, digits, is_signed>::value; |
| 210 | static _LIBCPP_CONSTEXPR const type __max = is_signed ? type(type(~0) ^ __min) : type(~0); |
| 211 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __min;} |
| 212 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __max;} |
| 213 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return min();} |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 214 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 215 | static _LIBCPP_CONSTEXPR const bool is_integer = true; |
| 216 | static _LIBCPP_CONSTEXPR const bool is_exact = true; |
| 217 | static _LIBCPP_CONSTEXPR const int radix = 2; |
| 218 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return type(0);} |
| 219 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return type(0);} |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 220 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 221 | static _LIBCPP_CONSTEXPR const int min_exponent = 0; |
| 222 | static _LIBCPP_CONSTEXPR const int min_exponent10 = 0; |
| 223 | static _LIBCPP_CONSTEXPR const int max_exponent = 0; |
| 224 | static _LIBCPP_CONSTEXPR const int max_exponent10 = 0; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 225 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 226 | static _LIBCPP_CONSTEXPR const bool has_infinity = false; |
| 227 | static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = false; |
| 228 | static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = false; |
| 229 | static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = denorm_absent; |
| 230 | static _LIBCPP_CONSTEXPR const bool has_denorm_loss = false; |
| 231 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return type(0);} |
| 232 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return type(0);} |
| 233 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return type(0);} |
| 234 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return type(0);} |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 235 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 236 | static _LIBCPP_CONSTEXPR const bool is_iec559 = false; |
| 237 | static _LIBCPP_CONSTEXPR const bool is_bounded = true; |
Marshall Clow | e7d8cce | 2014-07-31 01:18:05 +0000 | [diff] [blame] | 238 | static _LIBCPP_CONSTEXPR const bool is_modulo = !_VSTD::is_signed<_Tp>::value; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 239 | |
Dan Gohman | 33325ae | 2016-01-13 16:32:00 +0000 | [diff] [blame] | 240 | #if defined(__i386__) || defined(__x86_64__) || defined(__pnacl__) || \ |
| 241 | defined(__wasm__) |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 242 | static _LIBCPP_CONSTEXPR const bool traps = true; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 243 | #else |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 244 | static _LIBCPP_CONSTEXPR const bool traps = false; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 245 | #endif |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 246 | static _LIBCPP_CONSTEXPR const bool tinyness_before = false; |
| 247 | static _LIBCPP_CONSTEXPR const float_round_style round_style = round_toward_zero; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 248 | }; |
| 249 | |
| 250 | template <> |
| 251 | class __libcpp_numeric_limits<bool, true> |
| 252 | { |
| 253 | protected: |
| 254 | typedef bool type; |
| 255 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 256 | static _LIBCPP_CONSTEXPR const bool is_specialized = true; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 257 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 258 | static _LIBCPP_CONSTEXPR const bool is_signed = false; |
| 259 | static _LIBCPP_CONSTEXPR const int digits = 1; |
| 260 | static _LIBCPP_CONSTEXPR const int digits10 = 0; |
| 261 | static _LIBCPP_CONSTEXPR const int max_digits10 = 0; |
| 262 | static _LIBCPP_CONSTEXPR const type __min = false; |
| 263 | static _LIBCPP_CONSTEXPR const type __max = true; |
| 264 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __min;} |
| 265 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __max;} |
| 266 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return min();} |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 267 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 268 | static _LIBCPP_CONSTEXPR const bool is_integer = true; |
| 269 | static _LIBCPP_CONSTEXPR const bool is_exact = true; |
| 270 | static _LIBCPP_CONSTEXPR const int radix = 2; |
| 271 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return type(0);} |
| 272 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return type(0);} |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 273 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 274 | static _LIBCPP_CONSTEXPR const int min_exponent = 0; |
| 275 | static _LIBCPP_CONSTEXPR const int min_exponent10 = 0; |
| 276 | static _LIBCPP_CONSTEXPR const int max_exponent = 0; |
| 277 | static _LIBCPP_CONSTEXPR const int max_exponent10 = 0; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 278 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 279 | static _LIBCPP_CONSTEXPR const bool has_infinity = false; |
| 280 | static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = false; |
| 281 | static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = false; |
| 282 | static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = denorm_absent; |
| 283 | static _LIBCPP_CONSTEXPR const bool has_denorm_loss = false; |
| 284 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return type(0);} |
| 285 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return type(0);} |
| 286 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return type(0);} |
| 287 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return type(0);} |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 288 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 289 | static _LIBCPP_CONSTEXPR const bool is_iec559 = false; |
| 290 | static _LIBCPP_CONSTEXPR const bool is_bounded = true; |
| 291 | static _LIBCPP_CONSTEXPR const bool is_modulo = false; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 292 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 293 | static _LIBCPP_CONSTEXPR const bool traps = false; |
| 294 | static _LIBCPP_CONSTEXPR const bool tinyness_before = false; |
| 295 | static _LIBCPP_CONSTEXPR const float_round_style round_style = round_toward_zero; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 296 | }; |
| 297 | |
| 298 | template <> |
| 299 | class __libcpp_numeric_limits<float, true> |
| 300 | { |
| 301 | protected: |
| 302 | typedef float type; |
| 303 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 304 | static _LIBCPP_CONSTEXPR const bool is_specialized = true; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 305 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 306 | static _LIBCPP_CONSTEXPR const bool is_signed = true; |
| 307 | static _LIBCPP_CONSTEXPR const int digits = __FLT_MANT_DIG__; |
| 308 | static _LIBCPP_CONSTEXPR const int digits10 = __FLT_DIG__; |
Eric Fiselier | e0ba2ba | 2016-12-08 07:30:01 +0000 | [diff] [blame] | 309 | static _LIBCPP_CONSTEXPR const int max_digits10 = 2+(digits * 30103l)/100000l; |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 310 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __FLT_MIN__;} |
| 311 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __FLT_MAX__;} |
| 312 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return -max();} |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 313 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 314 | static _LIBCPP_CONSTEXPR const bool is_integer = false; |
| 315 | static _LIBCPP_CONSTEXPR const bool is_exact = false; |
| 316 | static _LIBCPP_CONSTEXPR const int radix = __FLT_RADIX__; |
| 317 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return __FLT_EPSILON__;} |
| 318 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return 0.5F;} |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 319 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 320 | static _LIBCPP_CONSTEXPR const int min_exponent = __FLT_MIN_EXP__; |
| 321 | static _LIBCPP_CONSTEXPR const int min_exponent10 = __FLT_MIN_10_EXP__; |
| 322 | static _LIBCPP_CONSTEXPR const int max_exponent = __FLT_MAX_EXP__; |
| 323 | static _LIBCPP_CONSTEXPR const int max_exponent10 = __FLT_MAX_10_EXP__; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 324 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 325 | static _LIBCPP_CONSTEXPR const bool has_infinity = true; |
| 326 | static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = true; |
| 327 | static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = true; |
| 328 | static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = denorm_present; |
| 329 | static _LIBCPP_CONSTEXPR const bool has_denorm_loss = false; |
| 330 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return __builtin_huge_valf();} |
| 331 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __builtin_nanf("");} |
| 332 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansf("");} |
| 333 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __FLT_DENORM_MIN__;} |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 334 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 335 | static _LIBCPP_CONSTEXPR const bool is_iec559 = true; |
| 336 | static _LIBCPP_CONSTEXPR const bool is_bounded = true; |
| 337 | static _LIBCPP_CONSTEXPR const bool is_modulo = false; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 338 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 339 | static _LIBCPP_CONSTEXPR const bool traps = false; |
| 340 | static _LIBCPP_CONSTEXPR const bool tinyness_before = false; |
| 341 | static _LIBCPP_CONSTEXPR const float_round_style round_style = round_to_nearest; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 342 | }; |
| 343 | |
| 344 | template <> |
| 345 | class __libcpp_numeric_limits<double, true> |
| 346 | { |
| 347 | protected: |
| 348 | typedef double type; |
| 349 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 350 | static _LIBCPP_CONSTEXPR const bool is_specialized = true; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 351 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 352 | static _LIBCPP_CONSTEXPR const bool is_signed = true; |
| 353 | static _LIBCPP_CONSTEXPR const int digits = __DBL_MANT_DIG__; |
| 354 | static _LIBCPP_CONSTEXPR const int digits10 = __DBL_DIG__; |
Eric Fiselier | e0ba2ba | 2016-12-08 07:30:01 +0000 | [diff] [blame] | 355 | static _LIBCPP_CONSTEXPR const int max_digits10 = 2+(digits * 30103l)/100000l; |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 356 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __DBL_MIN__;} |
| 357 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __DBL_MAX__;} |
| 358 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return -max();} |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 359 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 360 | static _LIBCPP_CONSTEXPR const bool is_integer = false; |
| 361 | static _LIBCPP_CONSTEXPR const bool is_exact = false; |
| 362 | static _LIBCPP_CONSTEXPR const int radix = __FLT_RADIX__; |
| 363 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return __DBL_EPSILON__;} |
| 364 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return 0.5;} |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 365 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 366 | static _LIBCPP_CONSTEXPR const int min_exponent = __DBL_MIN_EXP__; |
| 367 | static _LIBCPP_CONSTEXPR const int min_exponent10 = __DBL_MIN_10_EXP__; |
| 368 | static _LIBCPP_CONSTEXPR const int max_exponent = __DBL_MAX_EXP__; |
| 369 | static _LIBCPP_CONSTEXPR const int max_exponent10 = __DBL_MAX_10_EXP__; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 370 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 371 | static _LIBCPP_CONSTEXPR const bool has_infinity = true; |
| 372 | static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = true; |
| 373 | static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = true; |
| 374 | static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = denorm_present; |
| 375 | static _LIBCPP_CONSTEXPR const bool has_denorm_loss = false; |
| 376 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return __builtin_huge_val();} |
| 377 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __builtin_nan("");} |
| 378 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nans("");} |
| 379 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __DBL_DENORM_MIN__;} |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 380 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 381 | static _LIBCPP_CONSTEXPR const bool is_iec559 = true; |
| 382 | static _LIBCPP_CONSTEXPR const bool is_bounded = true; |
| 383 | static _LIBCPP_CONSTEXPR const bool is_modulo = false; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 384 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 385 | static _LIBCPP_CONSTEXPR const bool traps = false; |
| 386 | static _LIBCPP_CONSTEXPR const bool tinyness_before = false; |
| 387 | static _LIBCPP_CONSTEXPR const float_round_style round_style = round_to_nearest; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 388 | }; |
| 389 | |
| 390 | template <> |
| 391 | class __libcpp_numeric_limits<long double, true> |
| 392 | { |
| 393 | protected: |
| 394 | typedef long double type; |
| 395 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 396 | static _LIBCPP_CONSTEXPR const bool is_specialized = true; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 397 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 398 | static _LIBCPP_CONSTEXPR const bool is_signed = true; |
| 399 | static _LIBCPP_CONSTEXPR const int digits = __LDBL_MANT_DIG__; |
| 400 | static _LIBCPP_CONSTEXPR const int digits10 = __LDBL_DIG__; |
Eric Fiselier | e0ba2ba | 2016-12-08 07:30:01 +0000 | [diff] [blame] | 401 | static _LIBCPP_CONSTEXPR const int max_digits10 = 2+(digits * 30103l)/100000l; |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 402 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __LDBL_MIN__;} |
| 403 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __LDBL_MAX__;} |
| 404 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return -max();} |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 405 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 406 | static _LIBCPP_CONSTEXPR const bool is_integer = false; |
| 407 | static _LIBCPP_CONSTEXPR const bool is_exact = false; |
| 408 | static _LIBCPP_CONSTEXPR const int radix = __FLT_RADIX__; |
| 409 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return __LDBL_EPSILON__;} |
| 410 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return 0.5;} |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 411 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 412 | static _LIBCPP_CONSTEXPR const int min_exponent = __LDBL_MIN_EXP__; |
| 413 | static _LIBCPP_CONSTEXPR const int min_exponent10 = __LDBL_MIN_10_EXP__; |
| 414 | static _LIBCPP_CONSTEXPR const int max_exponent = __LDBL_MAX_EXP__; |
| 415 | static _LIBCPP_CONSTEXPR const int max_exponent10 = __LDBL_MAX_10_EXP__; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 416 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 417 | static _LIBCPP_CONSTEXPR const bool has_infinity = true; |
| 418 | static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = true; |
| 419 | static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = true; |
| 420 | static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = denorm_present; |
| 421 | static _LIBCPP_CONSTEXPR const bool has_denorm_loss = false; |
| 422 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return __builtin_huge_vall();} |
| 423 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __builtin_nanl("");} |
| 424 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __builtin_nansl("");} |
| 425 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __LDBL_DENORM_MIN__;} |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 426 | |
| 427 | #if (defined(__ppc__) || defined(__ppc64__)) |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 428 | static _LIBCPP_CONSTEXPR const bool is_iec559 = false; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 429 | #else |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 430 | static _LIBCPP_CONSTEXPR const bool is_iec559 = true; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 431 | #endif |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 432 | static _LIBCPP_CONSTEXPR const bool is_bounded = true; |
| 433 | static _LIBCPP_CONSTEXPR const bool is_modulo = false; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 434 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 435 | static _LIBCPP_CONSTEXPR const bool traps = false; |
| 436 | static _LIBCPP_CONSTEXPR const bool tinyness_before = false; |
| 437 | static _LIBCPP_CONSTEXPR const float_round_style round_style = round_to_nearest; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 438 | }; |
| 439 | |
| 440 | template <class _Tp> |
Eric Fiselier | b5eb1bf | 2017-01-04 23:56:00 +0000 | [diff] [blame^] | 441 | class _LIBCPP_TEMPLATE_VIS numeric_limits |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 442 | : private __libcpp_numeric_limits<typename remove_cv<_Tp>::type> |
| 443 | { |
| 444 | typedef __libcpp_numeric_limits<typename remove_cv<_Tp>::type> __base; |
| 445 | typedef typename __base::type type; |
| 446 | public: |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 447 | static _LIBCPP_CONSTEXPR const bool is_specialized = __base::is_specialized; |
| 448 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __base::min();} |
| 449 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __base::max();} |
| 450 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return __base::lowest();} |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 451 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 452 | static _LIBCPP_CONSTEXPR const int digits = __base::digits; |
| 453 | static _LIBCPP_CONSTEXPR const int digits10 = __base::digits10; |
| 454 | static _LIBCPP_CONSTEXPR const int max_digits10 = __base::max_digits10; |
| 455 | static _LIBCPP_CONSTEXPR const bool is_signed = __base::is_signed; |
| 456 | static _LIBCPP_CONSTEXPR const bool is_integer = __base::is_integer; |
| 457 | static _LIBCPP_CONSTEXPR const bool is_exact = __base::is_exact; |
| 458 | static _LIBCPP_CONSTEXPR const int radix = __base::radix; |
| 459 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return __base::epsilon();} |
| 460 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return __base::round_error();} |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 461 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 462 | static _LIBCPP_CONSTEXPR const int min_exponent = __base::min_exponent; |
| 463 | static _LIBCPP_CONSTEXPR const int min_exponent10 = __base::min_exponent10; |
| 464 | static _LIBCPP_CONSTEXPR const int max_exponent = __base::max_exponent; |
| 465 | static _LIBCPP_CONSTEXPR const int max_exponent10 = __base::max_exponent10; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 466 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 467 | static _LIBCPP_CONSTEXPR const bool has_infinity = __base::has_infinity; |
| 468 | static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = __base::has_quiet_NaN; |
| 469 | static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = __base::has_signaling_NaN; |
| 470 | static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = __base::has_denorm; |
| 471 | static _LIBCPP_CONSTEXPR const bool has_denorm_loss = __base::has_denorm_loss; |
| 472 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return __base::infinity();} |
| 473 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();} |
| 474 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();} |
| 475 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __base::denorm_min();} |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 476 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 477 | static _LIBCPP_CONSTEXPR const bool is_iec559 = __base::is_iec559; |
| 478 | static _LIBCPP_CONSTEXPR const bool is_bounded = __base::is_bounded; |
| 479 | static _LIBCPP_CONSTEXPR const bool is_modulo = __base::is_modulo; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 480 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 481 | static _LIBCPP_CONSTEXPR const bool traps = __base::traps; |
| 482 | static _LIBCPP_CONSTEXPR const bool tinyness_before = __base::tinyness_before; |
| 483 | static _LIBCPP_CONSTEXPR const float_round_style round_style = __base::round_style; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 484 | }; |
| 485 | |
| 486 | template <class _Tp> |
Howard Hinnant | 2c45cb4 | 2012-12-12 21:14:28 +0000 | [diff] [blame] | 487 | _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_specialized; |
| 488 | template <class _Tp> |
| 489 | _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::digits; |
| 490 | template <class _Tp> |
| 491 | _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::digits10; |
| 492 | template <class _Tp> |
| 493 | _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::max_digits10; |
| 494 | template <class _Tp> |
| 495 | _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_signed; |
| 496 | template <class _Tp> |
| 497 | _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_integer; |
| 498 | template <class _Tp> |
| 499 | _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_exact; |
| 500 | template <class _Tp> |
| 501 | _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::radix; |
| 502 | template <class _Tp> |
| 503 | _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::min_exponent; |
| 504 | template <class _Tp> |
| 505 | _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::min_exponent10; |
| 506 | template <class _Tp> |
| 507 | _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::max_exponent; |
| 508 | template <class _Tp> |
| 509 | _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::max_exponent10; |
| 510 | template <class _Tp> |
| 511 | _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::has_infinity; |
| 512 | template <class _Tp> |
| 513 | _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::has_quiet_NaN; |
| 514 | template <class _Tp> |
| 515 | _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::has_signaling_NaN; |
| 516 | template <class _Tp> |
| 517 | _LIBCPP_CONSTEXPR const float_denorm_style numeric_limits<_Tp>::has_denorm; |
| 518 | template <class _Tp> |
| 519 | _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::has_denorm_loss; |
| 520 | template <class _Tp> |
| 521 | _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_iec559; |
| 522 | template <class _Tp> |
| 523 | _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_bounded; |
| 524 | template <class _Tp> |
| 525 | _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_modulo; |
| 526 | template <class _Tp> |
| 527 | _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::traps; |
| 528 | template <class _Tp> |
| 529 | _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::tinyness_before; |
| 530 | template <class _Tp> |
| 531 | _LIBCPP_CONSTEXPR const float_round_style numeric_limits<_Tp>::round_style; |
| 532 | |
| 533 | template <class _Tp> |
Eric Fiselier | b5eb1bf | 2017-01-04 23:56:00 +0000 | [diff] [blame^] | 534 | class _LIBCPP_TEMPLATE_VIS numeric_limits<const _Tp> |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 535 | : private numeric_limits<_Tp> |
| 536 | { |
| 537 | typedef numeric_limits<_Tp> __base; |
| 538 | typedef _Tp type; |
| 539 | public: |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 540 | static _LIBCPP_CONSTEXPR const bool is_specialized = __base::is_specialized; |
| 541 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __base::min();} |
| 542 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __base::max();} |
| 543 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return __base::lowest();} |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 544 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 545 | static _LIBCPP_CONSTEXPR const int digits = __base::digits; |
| 546 | static _LIBCPP_CONSTEXPR const int digits10 = __base::digits10; |
| 547 | static _LIBCPP_CONSTEXPR const int max_digits10 = __base::max_digits10; |
| 548 | static _LIBCPP_CONSTEXPR const bool is_signed = __base::is_signed; |
| 549 | static _LIBCPP_CONSTEXPR const bool is_integer = __base::is_integer; |
| 550 | static _LIBCPP_CONSTEXPR const bool is_exact = __base::is_exact; |
| 551 | static _LIBCPP_CONSTEXPR const int radix = __base::radix; |
| 552 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return __base::epsilon();} |
| 553 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return __base::round_error();} |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 554 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 555 | static _LIBCPP_CONSTEXPR const int min_exponent = __base::min_exponent; |
| 556 | static _LIBCPP_CONSTEXPR const int min_exponent10 = __base::min_exponent10; |
| 557 | static _LIBCPP_CONSTEXPR const int max_exponent = __base::max_exponent; |
| 558 | static _LIBCPP_CONSTEXPR const int max_exponent10 = __base::max_exponent10; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 559 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 560 | static _LIBCPP_CONSTEXPR const bool has_infinity = __base::has_infinity; |
| 561 | static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = __base::has_quiet_NaN; |
| 562 | static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = __base::has_signaling_NaN; |
| 563 | static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = __base::has_denorm; |
| 564 | static _LIBCPP_CONSTEXPR const bool has_denorm_loss = __base::has_denorm_loss; |
| 565 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return __base::infinity();} |
| 566 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();} |
| 567 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();} |
| 568 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __base::denorm_min();} |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 569 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 570 | static _LIBCPP_CONSTEXPR const bool is_iec559 = __base::is_iec559; |
| 571 | static _LIBCPP_CONSTEXPR const bool is_bounded = __base::is_bounded; |
| 572 | static _LIBCPP_CONSTEXPR const bool is_modulo = __base::is_modulo; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 573 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 574 | static _LIBCPP_CONSTEXPR const bool traps = __base::traps; |
| 575 | static _LIBCPP_CONSTEXPR const bool tinyness_before = __base::tinyness_before; |
| 576 | static _LIBCPP_CONSTEXPR const float_round_style round_style = __base::round_style; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 577 | }; |
| 578 | |
| 579 | template <class _Tp> |
Howard Hinnant | 2c45cb4 | 2012-12-12 21:14:28 +0000 | [diff] [blame] | 580 | _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::is_specialized; |
| 581 | template <class _Tp> |
| 582 | _LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::digits; |
| 583 | template <class _Tp> |
| 584 | _LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::digits10; |
| 585 | template <class _Tp> |
| 586 | _LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::max_digits10; |
| 587 | template <class _Tp> |
| 588 | _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::is_signed; |
| 589 | template <class _Tp> |
| 590 | _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::is_integer; |
| 591 | template <class _Tp> |
| 592 | _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::is_exact; |
| 593 | template <class _Tp> |
| 594 | _LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::radix; |
| 595 | template <class _Tp> |
| 596 | _LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::min_exponent; |
| 597 | template <class _Tp> |
| 598 | _LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::min_exponent10; |
| 599 | template <class _Tp> |
| 600 | _LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::max_exponent; |
| 601 | template <class _Tp> |
| 602 | _LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::max_exponent10; |
| 603 | template <class _Tp> |
| 604 | _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::has_infinity; |
| 605 | template <class _Tp> |
| 606 | _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::has_quiet_NaN; |
| 607 | template <class _Tp> |
| 608 | _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::has_signaling_NaN; |
| 609 | template <class _Tp> |
| 610 | _LIBCPP_CONSTEXPR const float_denorm_style numeric_limits<const _Tp>::has_denorm; |
| 611 | template <class _Tp> |
| 612 | _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::has_denorm_loss; |
| 613 | template <class _Tp> |
| 614 | _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::is_iec559; |
| 615 | template <class _Tp> |
| 616 | _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::is_bounded; |
| 617 | template <class _Tp> |
| 618 | _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::is_modulo; |
| 619 | template <class _Tp> |
| 620 | _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::traps; |
| 621 | template <class _Tp> |
| 622 | _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::tinyness_before; |
| 623 | template <class _Tp> |
| 624 | _LIBCPP_CONSTEXPR const float_round_style numeric_limits<const _Tp>::round_style; |
| 625 | |
| 626 | template <class _Tp> |
Eric Fiselier | b5eb1bf | 2017-01-04 23:56:00 +0000 | [diff] [blame^] | 627 | class _LIBCPP_TEMPLATE_VIS numeric_limits<volatile _Tp> |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 628 | : private numeric_limits<_Tp> |
| 629 | { |
| 630 | typedef numeric_limits<_Tp> __base; |
| 631 | typedef _Tp type; |
| 632 | public: |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 633 | static _LIBCPP_CONSTEXPR const bool is_specialized = __base::is_specialized; |
| 634 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __base::min();} |
| 635 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __base::max();} |
| 636 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return __base::lowest();} |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 637 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 638 | static _LIBCPP_CONSTEXPR const int digits = __base::digits; |
| 639 | static _LIBCPP_CONSTEXPR const int digits10 = __base::digits10; |
| 640 | static _LIBCPP_CONSTEXPR const int max_digits10 = __base::max_digits10; |
| 641 | static _LIBCPP_CONSTEXPR const bool is_signed = __base::is_signed; |
| 642 | static _LIBCPP_CONSTEXPR const bool is_integer = __base::is_integer; |
| 643 | static _LIBCPP_CONSTEXPR const bool is_exact = __base::is_exact; |
| 644 | static _LIBCPP_CONSTEXPR const int radix = __base::radix; |
| 645 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return __base::epsilon();} |
| 646 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return __base::round_error();} |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 647 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 648 | static _LIBCPP_CONSTEXPR const int min_exponent = __base::min_exponent; |
| 649 | static _LIBCPP_CONSTEXPR const int min_exponent10 = __base::min_exponent10; |
| 650 | static _LIBCPP_CONSTEXPR const int max_exponent = __base::max_exponent; |
| 651 | static _LIBCPP_CONSTEXPR const int max_exponent10 = __base::max_exponent10; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 652 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 653 | static _LIBCPP_CONSTEXPR const bool has_infinity = __base::has_infinity; |
| 654 | static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = __base::has_quiet_NaN; |
| 655 | static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = __base::has_signaling_NaN; |
| 656 | static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = __base::has_denorm; |
| 657 | static _LIBCPP_CONSTEXPR const bool has_denorm_loss = __base::has_denorm_loss; |
| 658 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return __base::infinity();} |
| 659 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();} |
| 660 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();} |
| 661 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __base::denorm_min();} |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 662 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 663 | static _LIBCPP_CONSTEXPR const bool is_iec559 = __base::is_iec559; |
| 664 | static _LIBCPP_CONSTEXPR const bool is_bounded = __base::is_bounded; |
| 665 | static _LIBCPP_CONSTEXPR const bool is_modulo = __base::is_modulo; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 666 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 667 | static _LIBCPP_CONSTEXPR const bool traps = __base::traps; |
| 668 | static _LIBCPP_CONSTEXPR const bool tinyness_before = __base::tinyness_before; |
| 669 | static _LIBCPP_CONSTEXPR const float_round_style round_style = __base::round_style; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 670 | }; |
| 671 | |
| 672 | template <class _Tp> |
Howard Hinnant | 2c45cb4 | 2012-12-12 21:14:28 +0000 | [diff] [blame] | 673 | _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_specialized; |
| 674 | template <class _Tp> |
| 675 | _LIBCPP_CONSTEXPR const int numeric_limits<volatile _Tp>::digits; |
| 676 | template <class _Tp> |
| 677 | _LIBCPP_CONSTEXPR const int numeric_limits<volatile _Tp>::digits10; |
| 678 | template <class _Tp> |
| 679 | _LIBCPP_CONSTEXPR const int numeric_limits<volatile _Tp>::max_digits10; |
| 680 | template <class _Tp> |
| 681 | _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_signed; |
| 682 | template <class _Tp> |
| 683 | _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_integer; |
| 684 | template <class _Tp> |
| 685 | _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_exact; |
| 686 | template <class _Tp> |
| 687 | _LIBCPP_CONSTEXPR const int numeric_limits<volatile _Tp>::radix; |
| 688 | template <class _Tp> |
| 689 | _LIBCPP_CONSTEXPR const int numeric_limits<volatile _Tp>::min_exponent; |
| 690 | template <class _Tp> |
| 691 | _LIBCPP_CONSTEXPR const int numeric_limits<volatile _Tp>::min_exponent10; |
| 692 | template <class _Tp> |
| 693 | _LIBCPP_CONSTEXPR const int numeric_limits<volatile _Tp>::max_exponent; |
| 694 | template <class _Tp> |
| 695 | _LIBCPP_CONSTEXPR const int numeric_limits<volatile _Tp>::max_exponent10; |
| 696 | template <class _Tp> |
| 697 | _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::has_infinity; |
| 698 | template <class _Tp> |
| 699 | _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::has_quiet_NaN; |
| 700 | template <class _Tp> |
| 701 | _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::has_signaling_NaN; |
| 702 | template <class _Tp> |
| 703 | _LIBCPP_CONSTEXPR const float_denorm_style numeric_limits<volatile _Tp>::has_denorm; |
| 704 | template <class _Tp> |
| 705 | _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::has_denorm_loss; |
| 706 | template <class _Tp> |
| 707 | _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_iec559; |
| 708 | template <class _Tp> |
| 709 | _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_bounded; |
| 710 | template <class _Tp> |
| 711 | _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_modulo; |
| 712 | template <class _Tp> |
| 713 | _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::traps; |
| 714 | template <class _Tp> |
| 715 | _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::tinyness_before; |
| 716 | template <class _Tp> |
| 717 | _LIBCPP_CONSTEXPR const float_round_style numeric_limits<volatile _Tp>::round_style; |
| 718 | |
| 719 | template <class _Tp> |
Eric Fiselier | b5eb1bf | 2017-01-04 23:56:00 +0000 | [diff] [blame^] | 720 | class _LIBCPP_TEMPLATE_VIS numeric_limits<const volatile _Tp> |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 721 | : private numeric_limits<_Tp> |
| 722 | { |
| 723 | typedef numeric_limits<_Tp> __base; |
| 724 | typedef _Tp type; |
| 725 | public: |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 726 | static _LIBCPP_CONSTEXPR const bool is_specialized = __base::is_specialized; |
| 727 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __base::min();} |
| 728 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __base::max();} |
| 729 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return __base::lowest();} |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 730 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 731 | static _LIBCPP_CONSTEXPR const int digits = __base::digits; |
| 732 | static _LIBCPP_CONSTEXPR const int digits10 = __base::digits10; |
| 733 | static _LIBCPP_CONSTEXPR const int max_digits10 = __base::max_digits10; |
| 734 | static _LIBCPP_CONSTEXPR const bool is_signed = __base::is_signed; |
| 735 | static _LIBCPP_CONSTEXPR const bool is_integer = __base::is_integer; |
| 736 | static _LIBCPP_CONSTEXPR const bool is_exact = __base::is_exact; |
| 737 | static _LIBCPP_CONSTEXPR const int radix = __base::radix; |
| 738 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return __base::epsilon();} |
| 739 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return __base::round_error();} |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 740 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 741 | static _LIBCPP_CONSTEXPR const int min_exponent = __base::min_exponent; |
| 742 | static _LIBCPP_CONSTEXPR const int min_exponent10 = __base::min_exponent10; |
| 743 | static _LIBCPP_CONSTEXPR const int max_exponent = __base::max_exponent; |
| 744 | static _LIBCPP_CONSTEXPR const int max_exponent10 = __base::max_exponent10; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 745 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 746 | static _LIBCPP_CONSTEXPR const bool has_infinity = __base::has_infinity; |
| 747 | static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = __base::has_quiet_NaN; |
| 748 | static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = __base::has_signaling_NaN; |
| 749 | static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = __base::has_denorm; |
| 750 | static _LIBCPP_CONSTEXPR const bool has_denorm_loss = __base::has_denorm_loss; |
| 751 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return __base::infinity();} |
| 752 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();} |
| 753 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();} |
| 754 | _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __base::denorm_min();} |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 755 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 756 | static _LIBCPP_CONSTEXPR const bool is_iec559 = __base::is_iec559; |
| 757 | static _LIBCPP_CONSTEXPR const bool is_bounded = __base::is_bounded; |
| 758 | static _LIBCPP_CONSTEXPR const bool is_modulo = __base::is_modulo; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 759 | |
Howard Hinnant | 50ed0b2 | 2012-04-02 19:23:15 +0000 | [diff] [blame] | 760 | static _LIBCPP_CONSTEXPR const bool traps = __base::traps; |
| 761 | static _LIBCPP_CONSTEXPR const bool tinyness_before = __base::tinyness_before; |
| 762 | static _LIBCPP_CONSTEXPR const float_round_style round_style = __base::round_style; |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 763 | }; |
| 764 | |
Howard Hinnant | 2c45cb4 | 2012-12-12 21:14:28 +0000 | [diff] [blame] | 765 | template <class _Tp> |
| 766 | _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_specialized; |
| 767 | template <class _Tp> |
| 768 | _LIBCPP_CONSTEXPR const int numeric_limits<const volatile _Tp>::digits; |
| 769 | template <class _Tp> |
| 770 | _LIBCPP_CONSTEXPR const int numeric_limits<const volatile _Tp>::digits10; |
| 771 | template <class _Tp> |
Nico Weber | f78c8f6 | 2014-05-30 12:09:47 +0000 | [diff] [blame] | 772 | _LIBCPP_CONSTEXPR const int numeric_limits<const volatile _Tp>::max_digits10; |
Howard Hinnant | 2c45cb4 | 2012-12-12 21:14:28 +0000 | [diff] [blame] | 773 | template <class _Tp> |
| 774 | _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_signed; |
| 775 | template <class _Tp> |
| 776 | _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_integer; |
| 777 | template <class _Tp> |
| 778 | _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_exact; |
| 779 | template <class _Tp> |
| 780 | _LIBCPP_CONSTEXPR const int numeric_limits<const volatile _Tp>::radix; |
| 781 | template <class _Tp> |
| 782 | _LIBCPP_CONSTEXPR const int numeric_limits<const volatile _Tp>::min_exponent; |
| 783 | template <class _Tp> |
| 784 | _LIBCPP_CONSTEXPR const int numeric_limits<const volatile _Tp>::min_exponent10; |
| 785 | template <class _Tp> |
| 786 | _LIBCPP_CONSTEXPR const int numeric_limits<const volatile _Tp>::max_exponent; |
| 787 | template <class _Tp> |
| 788 | _LIBCPP_CONSTEXPR const int numeric_limits<const volatile _Tp>::max_exponent10; |
| 789 | template <class _Tp> |
| 790 | _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::has_infinity; |
| 791 | template <class _Tp> |
| 792 | _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::has_quiet_NaN; |
| 793 | template <class _Tp> |
| 794 | _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::has_signaling_NaN; |
| 795 | template <class _Tp> |
| 796 | _LIBCPP_CONSTEXPR const float_denorm_style numeric_limits<const volatile _Tp>::has_denorm; |
| 797 | template <class _Tp> |
| 798 | _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::has_denorm_loss; |
| 799 | template <class _Tp> |
| 800 | _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_iec559; |
| 801 | template <class _Tp> |
| 802 | _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_bounded; |
| 803 | template <class _Tp> |
| 804 | _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_modulo; |
| 805 | template <class _Tp> |
| 806 | _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::traps; |
| 807 | template <class _Tp> |
| 808 | _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::tinyness_before; |
| 809 | template <class _Tp> |
| 810 | _LIBCPP_CONSTEXPR const float_round_style numeric_limits<const volatile _Tp>::round_style; |
| 811 | |
Howard Hinnant | c51e102 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 812 | _LIBCPP_END_NAMESPACE_STD |
| 813 | |
| 814 | #endif // _LIBCPP_LIMITS |