You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893
  1. // The template and inlines for the numeric_limits classes. -*- C++ -*-
  2. // Copyright (C) 1999-2020 Free Software Foundation, Inc.
  3. //
  4. // This file is part of the GNU ISO C++ Library. This library is free
  5. // software; you can redistribute it and/or modify it under the
  6. // terms of the GNU General Public License as published by the
  7. // Free Software Foundation; either version 3, or (at your option)
  8. // any later version.
  9. // This library is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. // Under Section 7 of GPL version 3, you are granted additional
  14. // permissions described in the GCC Runtime Library Exception, version
  15. // 3.1, as published by the Free Software Foundation.
  16. // You should have received a copy of the GNU General Public License and
  17. // a copy of the GCC Runtime Library Exception along with this program;
  18. // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  19. // <http://www.gnu.org/licenses/>.
  20. /** @file include/limits
  21. * This is a Standard C++ Library header.
  22. */
  23. // Note: this is not a conforming implementation.
  24. // Written by Gabriel Dos Reis <gdr@codesourcery.com>
  25. //
  26. // ISO 14882:1998
  27. // 18.2.1
  28. //
  29. #ifndef _GLIBCXX_NUMERIC_LIMITS
  30. #define _GLIBCXX_NUMERIC_LIMITS 1
  31. #pragma GCC system_header
  32. #include <bits/c++config.h>
  33. //
  34. // The numeric_limits<> traits document implementation-defined aspects
  35. // of fundamental arithmetic data types (integers and floating points).
  36. // From Standard C++ point of view, there are 14 such types:
  37. // * integers
  38. // bool (1)
  39. // char, signed char, unsigned char, wchar_t (4)
  40. // short, unsigned short (2)
  41. // int, unsigned (2)
  42. // long, unsigned long (2)
  43. //
  44. // * floating points
  45. // float (1)
  46. // double (1)
  47. // long double (1)
  48. //
  49. // GNU C++ understands (where supported by the host C-library)
  50. // * integer
  51. // long long, unsigned long long (2)
  52. //
  53. // which brings us to 16 fundamental arithmetic data types in GNU C++.
  54. //
  55. //
  56. // Since a numeric_limits<> is a bit tricky to get right, we rely on
  57. // an interface composed of macros which should be defined in config/os
  58. // or config/cpu when they differ from the generic (read arbitrary)
  59. // definitions given here.
  60. //
  61. // These values can be overridden in the target configuration file.
  62. // The default values are appropriate for many 32-bit targets.
  63. // GCC only intrinsically supports modulo integral types. The only remaining
  64. // integral exceptional values is division by zero. Only targets that do not
  65. // signal division by zero in some "hard to ignore" way should use false.
  66. #ifndef __glibcxx_integral_traps
  67. # define __glibcxx_integral_traps true
  68. #endif
  69. // float
  70. //
  71. // Default values. Should be overridden in configuration files if necessary.
  72. #ifndef __glibcxx_float_has_denorm_loss
  73. # define __glibcxx_float_has_denorm_loss false
  74. #endif
  75. #ifndef __glibcxx_float_traps
  76. # define __glibcxx_float_traps false
  77. #endif
  78. #ifndef __glibcxx_float_tinyness_before
  79. # define __glibcxx_float_tinyness_before false
  80. #endif
  81. // double
  82. // Default values. Should be overridden in configuration files if necessary.
  83. #ifndef __glibcxx_double_has_denorm_loss
  84. # define __glibcxx_double_has_denorm_loss false
  85. #endif
  86. #ifndef __glibcxx_double_traps
  87. # define __glibcxx_double_traps false
  88. #endif
  89. #ifndef __glibcxx_double_tinyness_before
  90. # define __glibcxx_double_tinyness_before false
  91. #endif
  92. // long double
  93. // Default values. Should be overridden in configuration files if necessary.
  94. #ifndef __glibcxx_long_double_has_denorm_loss
  95. # define __glibcxx_long_double_has_denorm_loss false
  96. #endif
  97. #ifndef __glibcxx_long_double_traps
  98. # define __glibcxx_long_double_traps false
  99. #endif
  100. #ifndef __glibcxx_long_double_tinyness_before
  101. # define __glibcxx_long_double_tinyness_before false
  102. #endif
  103. // You should not need to define any macros below this point.
  104. #define __glibcxx_signed_b(T,B) ((T)(-1) < 0)
  105. #define __glibcxx_min_b(T,B) \
  106. (__glibcxx_signed_b (T,B) ? -__glibcxx_max_b (T,B) - 1 : (T)0)
  107. #define __glibcxx_max_b(T,B) \
  108. (__glibcxx_signed_b (T,B) ? \
  109. (((((T)1 << (__glibcxx_digits_b (T,B) - 1)) - 1) << 1) + 1) : ~(T)0)
  110. #define __glibcxx_digits_b(T,B) \
  111. (B - __glibcxx_signed_b (T,B))
  112. // The fraction 643/2136 approximates log10(2) to 7 significant digits.
  113. #define __glibcxx_digits10_b(T,B) \
  114. (__glibcxx_digits_b (T,B) * 643L / 2136)
  115. #define __glibcxx_signed(T) \
  116. __glibcxx_signed_b (T, sizeof(T) * __CHAR_BIT__)
  117. #define __glibcxx_min(T) \
  118. __glibcxx_min_b (T, sizeof(T) * __CHAR_BIT__)
  119. #define __glibcxx_max(T) \
  120. __glibcxx_max_b (T, sizeof(T) * __CHAR_BIT__)
  121. #define __glibcxx_digits(T) \
  122. __glibcxx_digits_b (T, sizeof(T) * __CHAR_BIT__)
  123. #define __glibcxx_digits10(T) \
  124. __glibcxx_digits10_b (T, sizeof(T) * __CHAR_BIT__)
  125. #define __glibcxx_max_digits10(T) \
  126. (2 + (T) * 643L / 2136)
  127. namespace std _GLIBCXX_VISIBILITY(default)
  128. {
  129. _GLIBCXX_BEGIN_NAMESPACE_VERSION
  130. /**
  131. * @brief Describes the rounding style for floating-point types.
  132. *
  133. * This is used in the std::numeric_limits class.
  134. */
  135. enum float_round_style
  136. {
  137. round_indeterminate = -1, /// Intermediate.
  138. round_toward_zero = 0, /// To zero.
  139. round_to_nearest = 1, /// To the nearest representable value.
  140. round_toward_infinity = 2, /// To infinity.
  141. round_toward_neg_infinity = 3 /// To negative infinity.
  142. };
  143. /**
  144. * @brief Describes the denormalization for floating-point types.
  145. *
  146. * These values represent the presence or absence of a variable number
  147. * of exponent bits. This type is used in the std::numeric_limits class.
  148. */
  149. enum float_denorm_style
  150. {
  151. /// Indeterminate at compile time whether denormalized values are allowed.
  152. denorm_indeterminate = -1,
  153. /// The type does not allow denormalized values.
  154. denorm_absent = 0,
  155. /// The type allows denormalized values.
  156. denorm_present = 1
  157. };
  158. /**
  159. * @brief Part of std::numeric_limits.
  160. *
  161. * The @c static @c const members are usable as integral constant
  162. * expressions.
  163. *
  164. * @note This is a separate class for purposes of efficiency; you
  165. * should only access these members as part of an instantiation
  166. * of the std::numeric_limits class.
  167. */
  168. struct __numeric_limits_base
  169. {
  170. /** This will be true for all fundamental types (which have
  171. specializations), and false for everything else. */
  172. static _GLIBCXX_USE_CONSTEXPR bool is_specialized = false;
  173. /** The number of @c radix digits that be represented without change: for
  174. integer types, the number of non-sign bits in the mantissa; for
  175. floating types, the number of @c radix digits in the mantissa. */
  176. static _GLIBCXX_USE_CONSTEXPR int digits = 0;
  177. /** The number of base 10 digits that can be represented without change. */
  178. static _GLIBCXX_USE_CONSTEXPR int digits10 = 0;
  179. #if __cplusplus >= 201103L
  180. /** The number of base 10 digits required to ensure that values which
  181. differ are always differentiated. */
  182. static constexpr int max_digits10 = 0;
  183. #endif
  184. /** True if the type is signed. */
  185. static _GLIBCXX_USE_CONSTEXPR bool is_signed = false;
  186. /** True if the type is integer. */
  187. static _GLIBCXX_USE_CONSTEXPR bool is_integer = false;
  188. /** True if the type uses an exact representation. All integer types are
  189. exact, but not all exact types are integer. For example, rational and
  190. fixed-exponent representations are exact but not integer. */
  191. static _GLIBCXX_USE_CONSTEXPR bool is_exact = false;
  192. /** For integer types, specifies the base of the representation. For
  193. floating types, specifies the base of the exponent representation. */
  194. static _GLIBCXX_USE_CONSTEXPR int radix = 0;
  195. /** The minimum negative integer such that @c radix raised to the power of
  196. (one less than that integer) is a normalized floating point number. */
  197. static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
  198. /** The minimum negative integer such that 10 raised to that power is in
  199. the range of normalized floating point numbers. */
  200. static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0;
  201. /** The maximum positive integer such that @c radix raised to the power of
  202. (one less than that integer) is a representable finite floating point
  203. number. */
  204. static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0;
  205. /** The maximum positive integer such that 10 raised to that power is in
  206. the range of representable finite floating point numbers. */
  207. static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0;
  208. /** True if the type has a representation for positive infinity. */
  209. static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false;
  210. /** True if the type has a representation for a quiet (non-signaling)
  211. Not a Number. */
  212. static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false;
  213. /** True if the type has a representation for a signaling
  214. Not a Number. */
  215. static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false;
  216. /** See std::float_denorm_style for more information. */
  217. static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm = denorm_absent;
  218. /** True if loss of accuracy is detected as a denormalization loss,
  219. rather than as an inexact result. */
  220. static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
  221. /** True if-and-only-if the type adheres to the IEC 559 standard, also
  222. known as IEEE 754. (Only makes sense for floating point types.) */
  223. static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
  224. /** True if the set of values representable by the type is
  225. finite. All built-in types are bounded, this member would be
  226. false for arbitrary precision types. */
  227. static _GLIBCXX_USE_CONSTEXPR bool is_bounded = false;
  228. /** True if the type is @e modulo. A type is modulo if, for any
  229. operation involving +, -, or * on values of that type whose
  230. result would fall outside the range [min(),max()], the value
  231. returned differs from the true value by an integer multiple of
  232. max() - min() + 1. On most machines, this is false for floating
  233. types, true for unsigned integers, and true for signed integers.
  234. See PR22200 about signed integers. */
  235. static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false;
  236. /** True if trapping is implemented for this type. */
  237. static _GLIBCXX_USE_CONSTEXPR bool traps = false;
  238. /** True if tininess is detected before rounding. (see IEC 559) */
  239. static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;
  240. /** See std::float_round_style for more information. This is only
  241. meaningful for floating types; integer types will all be
  242. round_toward_zero. */
  243. static _GLIBCXX_USE_CONSTEXPR float_round_style round_style =
  244. round_toward_zero;
  245. };
  246. /**
  247. * @brief Properties of fundamental types.
  248. *
  249. * This class allows a program to obtain information about the
  250. * representation of a fundamental type on a given platform. For
  251. * non-fundamental types, the functions will return 0 and the data
  252. * members will all be @c false.
  253. */
  254. template<typename _Tp>
  255. struct numeric_limits : public __numeric_limits_base
  256. {
  257. /** The minimum finite value, or for floating types with
  258. denormalization, the minimum positive normalized value. */
  259. static _GLIBCXX_CONSTEXPR _Tp
  260. min() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
  261. /** The maximum finite value. */
  262. static _GLIBCXX_CONSTEXPR _Tp
  263. max() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
  264. #if __cplusplus >= 201103L
  265. /** A finite value x such that there is no other finite value y
  266. * where y < x. */
  267. static constexpr _Tp
  268. lowest() noexcept { return _Tp(); }
  269. #endif
  270. /** The @e machine @e epsilon: the difference between 1 and the least
  271. value greater than 1 that is representable. */
  272. static _GLIBCXX_CONSTEXPR _Tp
  273. epsilon() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
  274. /** The maximum rounding error measurement (see LIA-1). */
  275. static _GLIBCXX_CONSTEXPR _Tp
  276. round_error() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
  277. /** The representation of positive infinity, if @c has_infinity. */
  278. static _GLIBCXX_CONSTEXPR _Tp
  279. infinity() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
  280. /** The representation of a quiet Not a Number,
  281. if @c has_quiet_NaN. */
  282. static _GLIBCXX_CONSTEXPR _Tp
  283. quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
  284. /** The representation of a signaling Not a Number, if
  285. @c has_signaling_NaN. */
  286. static _GLIBCXX_CONSTEXPR _Tp
  287. signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
  288. /** The minimum positive denormalized value. For types where
  289. @c has_denorm is false, this is the minimum positive normalized
  290. value. */
  291. static _GLIBCXX_CONSTEXPR _Tp
  292. denorm_min() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
  293. };
  294. // _GLIBCXX_RESOLVE_LIB_DEFECTS
  295. // 559. numeric_limits<const T>
  296. template<typename _Tp>
  297. struct numeric_limits<const _Tp>
  298. : public numeric_limits<_Tp> { };
  299. template<typename _Tp>
  300. struct numeric_limits<volatile _Tp>
  301. : public numeric_limits<_Tp> { };
  302. template<typename _Tp>
  303. struct numeric_limits<const volatile _Tp>
  304. : public numeric_limits<_Tp> { };
  305. // Now there follow 16 explicit specializations. Yes, 16. Make sure
  306. // you get the count right. (18 in C++11 mode, with char16_t and char32_t.)
  307. // (+1 if char8_t is enabled.)
  308. // _GLIBCXX_RESOLVE_LIB_DEFECTS
  309. // 184. numeric_limits<bool> wording problems
  310. /// numeric_limits<bool> specialization.
  311. template<>
  312. struct numeric_limits<bool>
  313. {
  314. static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
  315. static _GLIBCXX_CONSTEXPR bool
  316. min() _GLIBCXX_USE_NOEXCEPT { return false; }
  317. static _GLIBCXX_CONSTEXPR bool
  318. max() _GLIBCXX_USE_NOEXCEPT { return true; }
  319. #if __cplusplus >= 201103L
  320. static constexpr bool
  321. lowest() noexcept { return min(); }
  322. #endif
  323. static _GLIBCXX_USE_CONSTEXPR int digits = 1;
  324. static _GLIBCXX_USE_CONSTEXPR int digits10 = 0;
  325. #if __cplusplus >= 201103L
  326. static constexpr int max_digits10 = 0;
  327. #endif
  328. static _GLIBCXX_USE_CONSTEXPR bool is_signed = false;
  329. static _GLIBCXX_USE_CONSTEXPR bool is_integer = true;
  330. static _GLIBCXX_USE_CONSTEXPR bool is_exact = true;
  331. static _GLIBCXX_USE_CONSTEXPR int radix = 2;
  332. static _GLIBCXX_CONSTEXPR bool
  333. epsilon() _GLIBCXX_USE_NOEXCEPT { return false; }
  334. static _GLIBCXX_CONSTEXPR bool
  335. round_error() _GLIBCXX_USE_NOEXCEPT { return false; }
  336. static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
  337. static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0;
  338. static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0;
  339. static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0;
  340. static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false;
  341. static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false;
  342. static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false;
  343. static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
  344. = denorm_absent;
  345. static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
  346. static _GLIBCXX_CONSTEXPR bool
  347. infinity() _GLIBCXX_USE_NOEXCEPT { return false; }
  348. static _GLIBCXX_CONSTEXPR bool
  349. quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return false; }
  350. static _GLIBCXX_CONSTEXPR bool
  351. signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return false; }
  352. static _GLIBCXX_CONSTEXPR bool
  353. denorm_min() _GLIBCXX_USE_NOEXCEPT { return false; }
  354. static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
  355. static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
  356. static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false;
  357. // It is not clear what it means for a boolean type to trap.
  358. // This is a DR on the LWG issue list. Here, I use integer
  359. // promotion semantics.
  360. static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps;
  361. static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;
  362. static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
  363. = round_toward_zero;
  364. };
  365. /// numeric_limits<char> specialization.
  366. template<>
  367. struct numeric_limits<char>
  368. {
  369. static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
  370. static _GLIBCXX_CONSTEXPR char
  371. min() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_min(char); }
  372. static _GLIBCXX_CONSTEXPR char
  373. max() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_max(char); }
  374. #if __cplusplus >= 201103L
  375. static constexpr char
  376. lowest() noexcept { return min(); }
  377. #endif
  378. static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (char);
  379. static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (char);
  380. #if __cplusplus >= 201103L
  381. static constexpr int max_digits10 = 0;
  382. #endif
  383. static _GLIBCXX_USE_CONSTEXPR bool is_signed = __glibcxx_signed (char);
  384. static _GLIBCXX_USE_CONSTEXPR bool is_integer = true;
  385. static _GLIBCXX_USE_CONSTEXPR bool is_exact = true;
  386. static _GLIBCXX_USE_CONSTEXPR int radix = 2;
  387. static _GLIBCXX_CONSTEXPR char
  388. epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; }
  389. static _GLIBCXX_CONSTEXPR char
  390. round_error() _GLIBCXX_USE_NOEXCEPT { return 0; }
  391. static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
  392. static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0;
  393. static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0;
  394. static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0;
  395. static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false;
  396. static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false;
  397. static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false;
  398. static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
  399. = denorm_absent;
  400. static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
  401. static _GLIBCXX_CONSTEXPR
  402. char infinity() _GLIBCXX_USE_NOEXCEPT { return char(); }
  403. static _GLIBCXX_CONSTEXPR char
  404. quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return char(); }
  405. static _GLIBCXX_CONSTEXPR char
  406. signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return char(); }
  407. static _GLIBCXX_CONSTEXPR char
  408. denorm_min() _GLIBCXX_USE_NOEXCEPT { return static_cast<char>(0); }
  409. static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
  410. static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
  411. static _GLIBCXX_USE_CONSTEXPR bool is_modulo = !is_signed;
  412. static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps;
  413. static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;
  414. static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
  415. = round_toward_zero;
  416. };
  417. /// numeric_limits<signed char> specialization.
  418. template<>
  419. struct numeric_limits<signed char>
  420. {
  421. static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
  422. static _GLIBCXX_CONSTEXPR signed char
  423. min() _GLIBCXX_USE_NOEXCEPT { return -__SCHAR_MAX__ - 1; }
  424. static _GLIBCXX_CONSTEXPR signed char
  425. max() _GLIBCXX_USE_NOEXCEPT { return __SCHAR_MAX__; }
  426. #if __cplusplus >= 201103L
  427. static constexpr signed char
  428. lowest() noexcept { return min(); }
  429. #endif
  430. static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (signed char);
  431. static _GLIBCXX_USE_CONSTEXPR int digits10
  432. = __glibcxx_digits10 (signed char);
  433. #if __cplusplus >= 201103L
  434. static constexpr int max_digits10 = 0;
  435. #endif
  436. static _GLIBCXX_USE_CONSTEXPR bool is_signed = true;
  437. static _GLIBCXX_USE_CONSTEXPR bool is_integer = true;
  438. static _GLIBCXX_USE_CONSTEXPR bool is_exact = true;
  439. static _GLIBCXX_USE_CONSTEXPR int radix = 2;
  440. static _GLIBCXX_CONSTEXPR signed char
  441. epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; }
  442. static _GLIBCXX_CONSTEXPR signed char
  443. round_error() _GLIBCXX_USE_NOEXCEPT { return 0; }
  444. static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
  445. static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0;
  446. static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0;
  447. static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0;
  448. static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false;
  449. static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false;
  450. static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false;
  451. static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
  452. = denorm_absent;
  453. static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
  454. static _GLIBCXX_CONSTEXPR signed char
  455. infinity() _GLIBCXX_USE_NOEXCEPT { return static_cast<signed char>(0); }
  456. static _GLIBCXX_CONSTEXPR signed char
  457. quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast<signed char>(0); }
  458. static _GLIBCXX_CONSTEXPR signed char
  459. signaling_NaN() _GLIBCXX_USE_NOEXCEPT
  460. { return static_cast<signed char>(0); }
  461. static _GLIBCXX_CONSTEXPR signed char
  462. denorm_min() _GLIBCXX_USE_NOEXCEPT
  463. { return static_cast<signed char>(0); }
  464. static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
  465. static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
  466. static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false;
  467. static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps;
  468. static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;
  469. static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
  470. = round_toward_zero;
  471. };
  472. /// numeric_limits<unsigned char> specialization.
  473. template<>
  474. struct numeric_limits<unsigned char>
  475. {
  476. static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
  477. static _GLIBCXX_CONSTEXPR unsigned char
  478. min() _GLIBCXX_USE_NOEXCEPT { return 0; }
  479. static _GLIBCXX_CONSTEXPR unsigned char
  480. max() _GLIBCXX_USE_NOEXCEPT { return __SCHAR_MAX__ * 2U + 1; }
  481. #if __cplusplus >= 201103L
  482. static constexpr unsigned char
  483. lowest() noexcept { return min(); }
  484. #endif
  485. static _GLIBCXX_USE_CONSTEXPR int digits
  486. = __glibcxx_digits (unsigned char);
  487. static _GLIBCXX_USE_CONSTEXPR int digits10
  488. = __glibcxx_digits10 (unsigned char);
  489. #if __cplusplus >= 201103L
  490. static constexpr int max_digits10 = 0;
  491. #endif
  492. static _GLIBCXX_USE_CONSTEXPR bool is_signed = false;
  493. static _GLIBCXX_USE_CONSTEXPR bool is_integer = true;
  494. static _GLIBCXX_USE_CONSTEXPR bool is_exact = true;
  495. static _GLIBCXX_USE_CONSTEXPR int radix = 2;
  496. static _GLIBCXX_CONSTEXPR unsigned char
  497. epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; }
  498. static _GLIBCXX_CONSTEXPR unsigned char
  499. round_error() _GLIBCXX_USE_NOEXCEPT { return 0; }
  500. static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
  501. static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0;
  502. static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0;
  503. static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0;
  504. static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false;
  505. static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false;
  506. static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false;
  507. static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
  508. = denorm_absent;
  509. static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
  510. static _GLIBCXX_CONSTEXPR unsigned char
  511. infinity() _GLIBCXX_USE_NOEXCEPT
  512. { return static_cast<unsigned char>(0); }
  513. static _GLIBCXX_CONSTEXPR unsigned char
  514. quiet_NaN() _GLIBCXX_USE_NOEXCEPT
  515. { return static_cast<unsigned char>(0); }
  516. static _GLIBCXX_CONSTEXPR unsigned char
  517. signaling_NaN() _GLIBCXX_USE_NOEXCEPT
  518. { return static_cast<unsigned char>(0); }
  519. static _GLIBCXX_CONSTEXPR unsigned char
  520. denorm_min() _GLIBCXX_USE_NOEXCEPT
  521. { return static_cast<unsigned char>(0); }
  522. static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
  523. static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
  524. static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true;
  525. static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps;
  526. static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;
  527. static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
  528. = round_toward_zero;
  529. };
  530. /// numeric_limits<wchar_t> specialization.
  531. template<>
  532. struct numeric_limits<wchar_t>
  533. {
  534. static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
  535. static _GLIBCXX_CONSTEXPR wchar_t
  536. min() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_min (wchar_t); }
  537. static _GLIBCXX_CONSTEXPR wchar_t
  538. max() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_max (wchar_t); }
  539. #if __cplusplus >= 201103L
  540. static constexpr wchar_t
  541. lowest() noexcept { return min(); }
  542. #endif
  543. static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (wchar_t);
  544. static _GLIBCXX_USE_CONSTEXPR int digits10
  545. = __glibcxx_digits10 (wchar_t);
  546. #if __cplusplus >= 201103L
  547. static constexpr int max_digits10 = 0;
  548. #endif
  549. static _GLIBCXX_USE_CONSTEXPR bool is_signed = __glibcxx_signed (wchar_t);
  550. static _GLIBCXX_USE_CONSTEXPR bool is_integer = true;
  551. static _GLIBCXX_USE_CONSTEXPR bool is_exact = true;
  552. static _GLIBCXX_USE_CONSTEXPR int radix = 2;
  553. static _GLIBCXX_CONSTEXPR wchar_t
  554. epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; }
  555. static _GLIBCXX_CONSTEXPR wchar_t
  556. round_error() _GLIBCXX_USE_NOEXCEPT { return 0; }
  557. static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
  558. static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0;
  559. static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0;
  560. static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0;
  561. static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false;
  562. static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false;
  563. static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false;
  564. static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
  565. = denorm_absent;
  566. static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
  567. static _GLIBCXX_CONSTEXPR wchar_t
  568. infinity() _GLIBCXX_USE_NOEXCEPT { return wchar_t(); }
  569. static _GLIBCXX_CONSTEXPR wchar_t
  570. quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return wchar_t(); }
  571. static _GLIBCXX_CONSTEXPR wchar_t
  572. signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return wchar_t(); }
  573. static _GLIBCXX_CONSTEXPR wchar_t
  574. denorm_min() _GLIBCXX_USE_NOEXCEPT { return wchar_t(); }
  575. static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
  576. static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
  577. static _GLIBCXX_USE_CONSTEXPR bool is_modulo = !is_signed;
  578. static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps;
  579. static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;
  580. static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
  581. = round_toward_zero;
  582. };
  583. #if _GLIBCXX_USE_CHAR8_T
  584. /// numeric_limits<char8_t> specialization.
  585. template<>
  586. struct numeric_limits<char8_t>
  587. {
  588. static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
  589. static _GLIBCXX_CONSTEXPR char8_t
  590. min() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_min (char8_t); }
  591. static _GLIBCXX_CONSTEXPR char8_t
  592. max() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_max (char8_t); }
  593. static _GLIBCXX_CONSTEXPR char8_t
  594. lowest() _GLIBCXX_USE_NOEXCEPT { return min(); }
  595. static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (char8_t);
  596. static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (char8_t);
  597. static _GLIBCXX_USE_CONSTEXPR int max_digits10 = 0;
  598. static _GLIBCXX_USE_CONSTEXPR bool is_signed = __glibcxx_signed (char8_t);
  599. static _GLIBCXX_USE_CONSTEXPR bool is_integer = true;
  600. static _GLIBCXX_USE_CONSTEXPR bool is_exact = true;
  601. static _GLIBCXX_USE_CONSTEXPR int radix = 2;
  602. static _GLIBCXX_CONSTEXPR char8_t
  603. epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; }
  604. static _GLIBCXX_CONSTEXPR char8_t
  605. round_error() _GLIBCXX_USE_NOEXCEPT { return 0; }
  606. static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
  607. static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0;
  608. static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0;
  609. static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0;
  610. static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false;
  611. static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false;
  612. static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false;
  613. static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
  614. = denorm_absent;
  615. static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
  616. static _GLIBCXX_CONSTEXPR char8_t
  617. infinity() _GLIBCXX_USE_NOEXCEPT { return char8_t(); }
  618. static _GLIBCXX_CONSTEXPR char8_t
  619. quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return char8_t(); }
  620. static _GLIBCXX_CONSTEXPR char8_t
  621. signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return char8_t(); }
  622. static _GLIBCXX_CONSTEXPR char8_t
  623. denorm_min() _GLIBCXX_USE_NOEXCEPT { return char8_t(); }
  624. static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
  625. static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
  626. static _GLIBCXX_USE_CONSTEXPR bool is_modulo = !is_signed;
  627. static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps;
  628. static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;
  629. static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
  630. = round_toward_zero;
  631. };
  632. #endif
  633. #if __cplusplus >= 201103L
  634. /// numeric_limits<char16_t> specialization.
  635. template<>
  636. struct numeric_limits<char16_t>
  637. {
  638. static constexpr bool is_specialized = true;
  639. static constexpr char16_t
  640. min() noexcept { return __glibcxx_min (char16_t); }
  641. static constexpr char16_t
  642. max() noexcept { return __glibcxx_max (char16_t); }
  643. static constexpr char16_t
  644. lowest() noexcept { return min(); }
  645. static constexpr int digits = __glibcxx_digits (char16_t);
  646. static constexpr int digits10 = __glibcxx_digits10 (char16_t);
  647. static constexpr int max_digits10 = 0;
  648. static constexpr bool is_signed = __glibcxx_signed (char16_t);
  649. static constexpr bool is_integer = true;
  650. static constexpr bool is_exact = true;
  651. static constexpr int radix = 2;
  652. static constexpr char16_t
  653. epsilon() noexcept { return 0; }
  654. static constexpr char16_t
  655. round_error() noexcept { return 0; }
  656. static constexpr int min_exponent = 0;
  657. static constexpr int min_exponent10 = 0;
  658. static constexpr int max_exponent = 0;
  659. static constexpr int max_exponent10 = 0;
  660. static constexpr bool has_infinity = false;
  661. static constexpr bool has_quiet_NaN = false;
  662. static constexpr bool has_signaling_NaN = false;
  663. static constexpr float_denorm_style has_denorm = denorm_absent;
  664. static constexpr bool has_denorm_loss = false;
  665. static constexpr char16_t
  666. infinity() noexcept { return char16_t(); }
  667. static constexpr char16_t
  668. quiet_NaN() noexcept { return char16_t(); }
  669. static constexpr char16_t
  670. signaling_NaN() noexcept { return char16_t(); }
  671. static constexpr char16_t
  672. denorm_min() noexcept { return char16_t(); }
  673. static constexpr bool is_iec559 = false;
  674. static constexpr bool is_bounded = true;
  675. static constexpr bool is_modulo = !is_signed;
  676. static constexpr bool traps = __glibcxx_integral_traps;
  677. static constexpr bool tinyness_before = false;
  678. static constexpr float_round_style round_style = round_toward_zero;
  679. };
  680. /// numeric_limits<char32_t> specialization.
  681. template<>
  682. struct numeric_limits<char32_t>
  683. {
  684. static constexpr bool is_specialized = true;
  685. static constexpr char32_t
  686. min() noexcept { return __glibcxx_min (char32_t); }
  687. static constexpr char32_t
  688. max() noexcept { return __glibcxx_max (char32_t); }
  689. static constexpr char32_t
  690. lowest() noexcept { return min(); }
  691. static constexpr int digits = __glibcxx_digits (char32_t);
  692. static constexpr int digits10 = __glibcxx_digits10 (char32_t);
  693. static constexpr int max_digits10 = 0;
  694. static constexpr bool is_signed = __glibcxx_signed (char32_t);
  695. static constexpr bool is_integer = true;
  696. static constexpr bool is_exact = true;
  697. static constexpr int radix = 2;
  698. static constexpr char32_t
  699. epsilon() noexcept { return 0; }
  700. static constexpr char32_t
  701. round_error() noexcept { return 0; }
  702. static constexpr int min_exponent = 0;
  703. static constexpr int min_exponent10 = 0;
  704. static constexpr int max_exponent = 0;
  705. static constexpr int max_exponent10 = 0;
  706. static constexpr bool has_infinity = false;
  707. static constexpr bool has_quiet_NaN = false;
  708. static constexpr bool has_signaling_NaN = false;
  709. static constexpr float_denorm_style has_denorm = denorm_absent;
  710. static constexpr bool has_denorm_loss = false;
  711. static constexpr char32_t
  712. infinity() noexcept { return char32_t(); }
  713. static constexpr char32_t
  714. quiet_NaN() noexcept { return char32_t(); }
  715. static constexpr char32_t
  716. signaling_NaN() noexcept { return char32_t(); }
  717. static constexpr char32_t
  718. denorm_min() noexcept { return char32_t(); }
  719. static constexpr bool is_iec559 = false;
  720. static constexpr bool is_bounded = true;
  721. static constexpr bool is_modulo = !is_signed;
  722. static constexpr bool traps = __glibcxx_integral_traps;
  723. static constexpr bool tinyness_before = false;
  724. static constexpr float_round_style round_style = round_toward_zero;
  725. };
  726. #endif
  727. /// numeric_limits<short> specialization.
  728. template<>
  729. struct numeric_limits<short>
  730. {
  731. static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
  732. static _GLIBCXX_CONSTEXPR short
  733. min() _GLIBCXX_USE_NOEXCEPT { return -__SHRT_MAX__ - 1; }
  734. static _GLIBCXX_CONSTEXPR short
  735. max() _GLIBCXX_USE_NOEXCEPT { return __SHRT_MAX__; }
  736. #if __cplusplus >= 201103L
  737. static constexpr short
  738. lowest() noexcept { return min(); }
  739. #endif
  740. static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (short);
  741. static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (short);
  742. #if __cplusplus >= 201103L
  743. static constexpr int max_digits10 = 0;
  744. #endif
  745. static _GLIBCXX_USE_CONSTEXPR bool is_signed = true;
  746. static _GLIBCXX_USE_CONSTEXPR bool is_integer = true;
  747. static _GLIBCXX_USE_CONSTEXPR bool is_exact = true;
  748. static _GLIBCXX_USE_CONSTEXPR int radix = 2;
  749. static _GLIBCXX_CONSTEXPR short
  750. epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; }
  751. static _GLIBCXX_CONSTEXPR short
  752. round_error() _GLIBCXX_USE_NOEXCEPT { return 0; }
  753. static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
  754. static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0;
  755. static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0;
  756. static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0;
  757. static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false;
  758. static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false;
  759. static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false;
  760. static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
  761. = denorm_absent;
  762. static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
  763. static _GLIBCXX_CONSTEXPR short
  764. infinity() _GLIBCXX_USE_NOEXCEPT { return short(); }
  765. static _GLIBCXX_CONSTEXPR short
  766. quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return short(); }
  767. static _GLIBCXX_CONSTEXPR short
  768. signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return short(); }
  769. static _GLIBCXX_CONSTEXPR short
  770. denorm_min() _GLIBCXX_USE_NOEXCEPT { return short(); }
  771. static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
  772. static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
  773. static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false;
  774. static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps;
  775. static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;
  776. static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
  777. = round_toward_zero;
  778. };
  779. /// numeric_limits<unsigned short> specialization.
  780. template<>
  781. struct numeric_limits<unsigned short>
  782. {
  783. static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
  784. static _GLIBCXX_CONSTEXPR unsigned short
  785. min() _GLIBCXX_USE_NOEXCEPT { return 0; }
  786. static _GLIBCXX_CONSTEXPR unsigned short
  787. max() _GLIBCXX_USE_NOEXCEPT { return __SHRT_MAX__ * 2U + 1; }
  788. #if __cplusplus >= 201103L
  789. static constexpr unsigned short
  790. lowest() noexcept { return min(); }
  791. #endif
  792. static _GLIBCXX_USE_CONSTEXPR int digits
  793. = __glibcxx_digits (unsigned short);
  794. static _GLIBCXX_USE_CONSTEXPR int digits10
  795. = __glibcxx_digits10 (unsigned short);
  796. #if __cplusplus >= 201103L
  797. static constexpr int max_digits10 = 0;
  798. #endif
  799. static _GLIBCXX_USE_CONSTEXPR bool is_signed = false;
  800. static _GLIBCXX_USE_CONSTEXPR bool is_integer = true;
  801. static _GLIBCXX_USE_CONSTEXPR bool is_exact = true;
  802. static _GLIBCXX_USE_CONSTEXPR int radix = 2;
  803. static _GLIBCXX_CONSTEXPR unsigned short
  804. epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; }
  805. static _GLIBCXX_CONSTEXPR unsigned short
  806. round_error() _GLIBCXX_USE_NOEXCEPT { return 0; }
  807. static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
  808. static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0;
  809. static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0;
  810. static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0;
  811. static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false;
  812. static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false;
  813. static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false;
  814. static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
  815. = denorm_absent;
  816. static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
  817. static _GLIBCXX_CONSTEXPR unsigned short
  818. infinity() _GLIBCXX_USE_NOEXCEPT
  819. { return static_cast<unsigned short>(0); }
  820. static _GLIBCXX_CONSTEXPR unsigned short
  821. quiet_NaN() _GLIBCXX_USE_NOEXCEPT
  822. { return static_cast<unsigned short>(0); }
  823. static _GLIBCXX_CONSTEXPR unsigned short
  824. signaling_NaN() _GLIBCXX_USE_NOEXCEPT
  825. { return static_cast<unsigned short>(0); }
  826. static _GLIBCXX_CONSTEXPR unsigned short
  827. denorm_min() _GLIBCXX_USE_NOEXCEPT
  828. { return static_cast<unsigned short>(0); }
  829. static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
  830. static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
  831. static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true;
  832. static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps;
  833. static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;
  834. static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
  835. = round_toward_zero;
  836. };
  837. /// numeric_limits<int> specialization.
  838. template<>
  839. struct numeric_limits<int>
  840. {
  841. static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
  842. static _GLIBCXX_CONSTEXPR int
  843. min() _GLIBCXX_USE_NOEXCEPT { return -__INT_MAX__ - 1; }
  844. static _GLIBCXX_CONSTEXPR int
  845. max() _GLIBCXX_USE_NOEXCEPT { return __INT_MAX__; }
  846. #if __cplusplus >= 201103L
  847. static constexpr int
  848. lowest() noexcept { return min(); }
  849. #endif
  850. static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (int);
  851. static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (int);
  852. #if __cplusplus >= 201103L
  853. static constexpr int max_digits10 = 0;
  854. #endif
  855. static _GLIBCXX_USE_CONSTEXPR bool is_signed = true;
  856. static _GLIBCXX_USE_CONSTEXPR bool is_integer = true;
  857. static _GLIBCXX_USE_CONSTEXPR bool is_exact = true;
  858. static _GLIBCXX_USE_CONSTEXPR int radix = 2;
  859. static _GLIBCXX_CONSTEXPR int
  860. epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; }
  861. static _GLIBCXX_CONSTEXPR int
  862. round_error() _GLIBCXX_USE_NOEXCEPT { return 0; }
  863. static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
  864. static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0;
  865. static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0;
  866. static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0;
  867. static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false;
  868. static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false;
  869. static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false;
  870. static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
  871. = denorm_absent;
  872. static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
  873. static _GLIBCXX_CONSTEXPR int
  874. infinity() _GLIBCXX_USE_NOEXCEPT { return static_cast<int>(0); }
  875. static _GLIBCXX_CONSTEXPR int
  876. quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast<int>(0); }
  877. static _GLIBCXX_CONSTEXPR int
  878. signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast<int>(0); }
  879. static _GLIBCXX_CONSTEXPR int
  880. denorm_min() _GLIBCXX_USE_NOEXCEPT { return static_cast<int>(0); }
  881. static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
  882. static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
  883. static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false;
  884. static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps;
  885. static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;
  886. static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
  887. = round_toward_zero;
  888. };
  889. /// numeric_limits<unsigned int> specialization.
  890. template<>
  891. struct numeric_limits<unsigned int>
  892. {
  893. static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
  894. static _GLIBCXX_CONSTEXPR unsigned int
  895. min() _GLIBCXX_USE_NOEXCEPT { return 0; }
  896. static _GLIBCXX_CONSTEXPR unsigned int
  897. max() _GLIBCXX_USE_NOEXCEPT { return __INT_MAX__ * 2U + 1; }
  898. #if __cplusplus >= 201103L
  899. static constexpr unsigned int
  900. lowest() noexcept { return min(); }
  901. #endif
  902. static _GLIBCXX_USE_CONSTEXPR int digits
  903. = __glibcxx_digits (unsigned int);
  904. static _GLIBCXX_USE_CONSTEXPR int digits10
  905. = __glibcxx_digits10 (unsigned int);
  906. #if __cplusplus >= 201103L
  907. static constexpr int max_digits10 = 0;
  908. #endif
  909. static _GLIBCXX_USE_CONSTEXPR bool is_signed = false;
  910. static _GLIBCXX_USE_CONSTEXPR bool is_integer = true;
  911. static _GLIBCXX_USE_CONSTEXPR bool is_exact = true;
  912. static _GLIBCXX_USE_CONSTEXPR int radix = 2;
  913. static _GLIBCXX_CONSTEXPR unsigned int
  914. epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; }
  915. static _GLIBCXX_CONSTEXPR unsigned int
  916. round_error() _GLIBCXX_USE_NOEXCEPT { return 0; }
  917. static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
  918. static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0;
  919. static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0;
  920. static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0;
  921. static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false;
  922. static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false;
  923. static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false;
  924. static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
  925. = denorm_absent;
  926. static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
  927. static _GLIBCXX_CONSTEXPR unsigned int
  928. infinity() _GLIBCXX_USE_NOEXCEPT { return static_cast<unsigned int>(0); }
  929. static _GLIBCXX_CONSTEXPR unsigned int
  930. quiet_NaN() _GLIBCXX_USE_NOEXCEPT
  931. { return static_cast<unsigned int>(0); }
  932. static _GLIBCXX_CONSTEXPR unsigned int
  933. signaling_NaN() _GLIBCXX_USE_NOEXCEPT
  934. { return static_cast<unsigned int>(0); }
  935. static _GLIBCXX_CONSTEXPR unsigned int
  936. denorm_min() _GLIBCXX_USE_NOEXCEPT
  937. { return static_cast<unsigned int>(0); }
  938. static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
  939. static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
  940. static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true;
  941. static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps;
  942. static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;
  943. static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
  944. = round_toward_zero;
  945. };
  946. /// numeric_limits<long> specialization.
  947. template<>
  948. struct numeric_limits<long>
  949. {
  950. static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
  951. static _GLIBCXX_CONSTEXPR long
  952. min() _GLIBCXX_USE_NOEXCEPT { return -__LONG_MAX__ - 1; }
  953. static _GLIBCXX_CONSTEXPR long
  954. max() _GLIBCXX_USE_NOEXCEPT { return __LONG_MAX__; }
  955. #if __cplusplus >= 201103L
  956. static constexpr long
  957. lowest() noexcept { return min(); }
  958. #endif
  959. static _GLIBCXX_USE_CONSTEXPR int digits = __glibcxx_digits (long);
  960. static _GLIBCXX_USE_CONSTEXPR int digits10 = __glibcxx_digits10 (long);
  961. #if __cplusplus >= 201103L
  962. static constexpr int max_digits10 = 0;
  963. #endif
  964. static _GLIBCXX_USE_CONSTEXPR bool is_signed = true;
  965. static _GLIBCXX_USE_CONSTEXPR bool is_integer = true;
  966. static _GLIBCXX_USE_CONSTEXPR bool is_exact = true;
  967. static _GLIBCXX_USE_CONSTEXPR int radix = 2;
  968. static _GLIBCXX_CONSTEXPR long
  969. epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; }
  970. static _GLIBCXX_CONSTEXPR long
  971. round_error() _GLIBCXX_USE_NOEXCEPT { return 0; }
  972. static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
  973. static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0;
  974. static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0;
  975. static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0;
  976. static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false;
  977. static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false;
  978. static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false;
  979. static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
  980. = denorm_absent;
  981. static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
  982. static _GLIBCXX_CONSTEXPR long
  983. infinity() _GLIBCXX_USE_NOEXCEPT { return static_cast<long>(0); }
  984. static _GLIBCXX_CONSTEXPR long
  985. quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast<long>(0); }
  986. static _GLIBCXX_CONSTEXPR long
  987. signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast<long>(0); }
  988. static _GLIBCXX_CONSTEXPR long
  989. denorm_min() _GLIBCXX_USE_NOEXCEPT { return static_cast<long>(0); }
  990. static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
  991. static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
  992. static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false;
  993. static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps;
  994. static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;
  995. static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
  996. = round_toward_zero;
  997. };
  998. /// numeric_limits<unsigned long> specialization.
  999. template<>
  1000. struct numeric_limits<unsigned long>
  1001. {
  1002. static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
  1003. static _GLIBCXX_CONSTEXPR unsigned long
  1004. min() _GLIBCXX_USE_NOEXCEPT { return 0; }
  1005. static _GLIBCXX_CONSTEXPR unsigned long
  1006. max() _GLIBCXX_USE_NOEXCEPT { return __LONG_MAX__ * 2UL + 1; }
  1007. #if __cplusplus >= 201103L
  1008. static constexpr unsigned long
  1009. lowest() noexcept { return min(); }
  1010. #endif
  1011. static _GLIBCXX_USE_CONSTEXPR int digits
  1012. = __glibcxx_digits (unsigned long);
  1013. static _GLIBCXX_USE_CONSTEXPR int digits10
  1014. = __glibcxx_digits10 (unsigned long);
  1015. #if __cplusplus >= 201103L
  1016. static constexpr int max_digits10 = 0;
  1017. #endif
  1018. static _GLIBCXX_USE_CONSTEXPR bool is_signed = false;
  1019. static _GLIBCXX_USE_CONSTEXPR bool is_integer = true;
  1020. static _GLIBCXX_USE_CONSTEXPR bool is_exact = true;
  1021. static _GLIBCXX_USE_CONSTEXPR int radix = 2;
  1022. static _GLIBCXX_CONSTEXPR unsigned long
  1023. epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; }
  1024. static _GLIBCXX_CONSTEXPR unsigned long
  1025. round_error() _GLIBCXX_USE_NOEXCEPT { return 0; }
  1026. static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
  1027. static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0;
  1028. static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0;
  1029. static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0;
  1030. static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false;
  1031. static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false;
  1032. static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false;
  1033. static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
  1034. = denorm_absent;
  1035. static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
  1036. static _GLIBCXX_CONSTEXPR unsigned long
  1037. infinity() _GLIBCXX_USE_NOEXCEPT
  1038. { return static_cast<unsigned long>(0); }
  1039. static _GLIBCXX_CONSTEXPR unsigned long
  1040. quiet_NaN() _GLIBCXX_USE_NOEXCEPT
  1041. { return static_cast<unsigned long>(0); }
  1042. static _GLIBCXX_CONSTEXPR unsigned long
  1043. signaling_NaN() _GLIBCXX_USE_NOEXCEPT
  1044. { return static_cast<unsigned long>(0); }
  1045. static _GLIBCXX_CONSTEXPR unsigned long
  1046. denorm_min() _GLIBCXX_USE_NOEXCEPT
  1047. { return static_cast<unsigned long>(0); }
  1048. static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
  1049. static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
  1050. static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true;
  1051. static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps;
  1052. static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;
  1053. static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
  1054. = round_toward_zero;
  1055. };
  1056. /// numeric_limits<long long> specialization.
  1057. template<>
  1058. struct numeric_limits<long long>
  1059. {
  1060. static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
  1061. static _GLIBCXX_CONSTEXPR long long
  1062. min() _GLIBCXX_USE_NOEXCEPT { return -__LONG_LONG_MAX__ - 1; }
  1063. static _GLIBCXX_CONSTEXPR long long
  1064. max() _GLIBCXX_USE_NOEXCEPT { return __LONG_LONG_MAX__; }
  1065. #if __cplusplus >= 201103L
  1066. static constexpr long long
  1067. lowest() noexcept { return min(); }
  1068. #endif
  1069. static _GLIBCXX_USE_CONSTEXPR int digits
  1070. = __glibcxx_digits (long long);
  1071. static _GLIBCXX_USE_CONSTEXPR int digits10
  1072. = __glibcxx_digits10 (long long);
  1073. #if __cplusplus >= 201103L
  1074. static constexpr int max_digits10 = 0;
  1075. #endif
  1076. static _GLIBCXX_USE_CONSTEXPR bool is_signed = true;
  1077. static _GLIBCXX_USE_CONSTEXPR bool is_integer = true;
  1078. static _GLIBCXX_USE_CONSTEXPR bool is_exact = true;
  1079. static _GLIBCXX_USE_CONSTEXPR int radix = 2;
  1080. static _GLIBCXX_CONSTEXPR long long
  1081. epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; }
  1082. static _GLIBCXX_CONSTEXPR long long
  1083. round_error() _GLIBCXX_USE_NOEXCEPT { return 0; }
  1084. static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
  1085. static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0;
  1086. static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0;
  1087. static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0;
  1088. static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false;
  1089. static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false;
  1090. static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false;
  1091. static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
  1092. = denorm_absent;
  1093. static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
  1094. static _GLIBCXX_CONSTEXPR long long
  1095. infinity() _GLIBCXX_USE_NOEXCEPT { return static_cast<long long>(0); }
  1096. static _GLIBCXX_CONSTEXPR long long
  1097. quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return static_cast<long long>(0); }
  1098. static _GLIBCXX_CONSTEXPR long long
  1099. signaling_NaN() _GLIBCXX_USE_NOEXCEPT
  1100. { return static_cast<long long>(0); }
  1101. static _GLIBCXX_CONSTEXPR long long
  1102. denorm_min() _GLIBCXX_USE_NOEXCEPT { return static_cast<long long>(0); }
  1103. static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
  1104. static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
  1105. static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false;
  1106. static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps;
  1107. static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;
  1108. static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
  1109. = round_toward_zero;
  1110. };
  1111. /// numeric_limits<unsigned long long> specialization.
  1112. template<>
  1113. struct numeric_limits<unsigned long long>
  1114. {
  1115. static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
  1116. static _GLIBCXX_CONSTEXPR unsigned long long
  1117. min() _GLIBCXX_USE_NOEXCEPT { return 0; }
  1118. static _GLIBCXX_CONSTEXPR unsigned long long
  1119. max() _GLIBCXX_USE_NOEXCEPT { return __LONG_LONG_MAX__ * 2ULL + 1; }
  1120. #if __cplusplus >= 201103L
  1121. static constexpr unsigned long long
  1122. lowest() noexcept { return min(); }
  1123. #endif
  1124. static _GLIBCXX_USE_CONSTEXPR int digits
  1125. = __glibcxx_digits (unsigned long long);
  1126. static _GLIBCXX_USE_CONSTEXPR int digits10
  1127. = __glibcxx_digits10 (unsigned long long);
  1128. #if __cplusplus >= 201103L
  1129. static constexpr int max_digits10 = 0;
  1130. #endif
  1131. static _GLIBCXX_USE_CONSTEXPR bool is_signed = false;
  1132. static _GLIBCXX_USE_CONSTEXPR bool is_integer = true;
  1133. static _GLIBCXX_USE_CONSTEXPR bool is_exact = true;
  1134. static _GLIBCXX_USE_CONSTEXPR int radix = 2;
  1135. static _GLIBCXX_CONSTEXPR unsigned long long
  1136. epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; }
  1137. static _GLIBCXX_CONSTEXPR unsigned long long
  1138. round_error() _GLIBCXX_USE_NOEXCEPT { return 0; }
  1139. static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0;
  1140. static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0;
  1141. static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0;
  1142. static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0;
  1143. static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false;
  1144. static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false;
  1145. static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false;
  1146. static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
  1147. = denorm_absent;
  1148. static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false;
  1149. static _GLIBCXX_CONSTEXPR unsigned long long
  1150. infinity() _GLIBCXX_USE_NOEXCEPT
  1151. { return static_cast<unsigned long long>(0); }
  1152. static _GLIBCXX_CONSTEXPR unsigned long long
  1153. quiet_NaN() _GLIBCXX_USE_NOEXCEPT
  1154. { return static_cast<unsigned long long>(0); }
  1155. static _GLIBCXX_CONSTEXPR unsigned long long
  1156. signaling_NaN() _GLIBCXX_USE_NOEXCEPT
  1157. { return static_cast<unsigned long long>(0); }
  1158. static _GLIBCXX_CONSTEXPR unsigned long long
  1159. denorm_min() _GLIBCXX_USE_NOEXCEPT
  1160. { return static_cast<unsigned long long>(0); }
  1161. static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false;
  1162. static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
  1163. static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true;
  1164. static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps;
  1165. static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false;
  1166. static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
  1167. = round_toward_zero;
  1168. };
  1169. #if !defined(__STRICT_ANSI__)
  1170. #define __INT_N(TYPE, BITSIZE, EXT, UEXT) \
  1171. template<> \
  1172. struct numeric_limits<TYPE> \
  1173. { \
  1174. static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; \
  1175. \
  1176. static _GLIBCXX_CONSTEXPR TYPE \
  1177. min() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_min_b (TYPE, BITSIZE); } \
  1178. \
  1179. static _GLIBCXX_CONSTEXPR TYPE \
  1180. max() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_max_b (TYPE, BITSIZE); } \
  1181. \
  1182. static _GLIBCXX_USE_CONSTEXPR int digits \
  1183. = BITSIZE - 1; \
  1184. static _GLIBCXX_USE_CONSTEXPR int digits10 \
  1185. = (BITSIZE - 1) * 643L / 2136; \
  1186. \
  1187. static _GLIBCXX_USE_CONSTEXPR bool is_signed = true; \
  1188. static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; \
  1189. static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; \
  1190. static _GLIBCXX_USE_CONSTEXPR int radix = 2; \
  1191. \
  1192. static _GLIBCXX_CONSTEXPR TYPE \
  1193. epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } \
  1194. \
  1195. static _GLIBCXX_CONSTEXPR TYPE \
  1196. round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } \
  1197. \
  1198. EXT \
  1199. \
  1200. static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; \
  1201. static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; \
  1202. static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; \
  1203. static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; \
  1204. \
  1205. static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; \
  1206. static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; \
  1207. static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; \
  1208. static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm \
  1209. = denorm_absent; \
  1210. static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; \
  1211. \
  1212. static _GLIBCXX_CONSTEXPR TYPE \
  1213. infinity() _GLIBCXX_USE_NOEXCEPT \
  1214. { return static_cast<TYPE>(0); } \
  1215. \
  1216. static _GLIBCXX_CONSTEXPR TYPE \
  1217. quiet_NaN() _GLIBCXX_USE_NOEXCEPT \
  1218. { return static_cast<TYPE>(0); } \
  1219. \
  1220. static _GLIBCXX_CONSTEXPR TYPE \
  1221. signaling_NaN() _GLIBCXX_USE_NOEXCEPT \
  1222. { return static_cast<TYPE>(0); } \
  1223. \
  1224. static _GLIBCXX_CONSTEXPR TYPE \
  1225. denorm_min() _GLIBCXX_USE_NOEXCEPT \
  1226. { return static_cast<TYPE>(0); } \
  1227. \
  1228. static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; \
  1229. static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; \
  1230. static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false; \
  1231. \
  1232. static _GLIBCXX_USE_CONSTEXPR bool traps \
  1233. = __glibcxx_integral_traps; \
  1234. static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; \
  1235. static _GLIBCXX_USE_CONSTEXPR float_round_style round_style \
  1236. = round_toward_zero; \
  1237. }; \
  1238. \
  1239. template<> \
  1240. struct numeric_limits<unsigned TYPE> \
  1241. { \
  1242. static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; \
  1243. \
  1244. static _GLIBCXX_CONSTEXPR unsigned TYPE \
  1245. min() _GLIBCXX_USE_NOEXCEPT { return 0; } \
  1246. \
  1247. static _GLIBCXX_CONSTEXPR unsigned TYPE \
  1248. max() _GLIBCXX_USE_NOEXCEPT \
  1249. { return __glibcxx_max_b (unsigned TYPE, BITSIZE); } \
  1250. \
  1251. UEXT \
  1252. \
  1253. static _GLIBCXX_USE_CONSTEXPR int digits \
  1254. = BITSIZE; \
  1255. static _GLIBCXX_USE_CONSTEXPR int digits10 \
  1256. = BITSIZE * 643L / 2136; \
  1257. static _GLIBCXX_USE_CONSTEXPR bool is_signed = false; \
  1258. static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; \
  1259. static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; \
  1260. static _GLIBCXX_USE_CONSTEXPR int radix = 2; \
  1261. \
  1262. static _GLIBCXX_CONSTEXPR unsigned TYPE \
  1263. epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } \
  1264. \
  1265. static _GLIBCXX_CONSTEXPR unsigned TYPE \
  1266. round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } \
  1267. \
  1268. static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; \
  1269. static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; \
  1270. static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; \
  1271. static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; \
  1272. \
  1273. static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; \
  1274. static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; \
  1275. static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; \
  1276. static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm \
  1277. = denorm_absent; \
  1278. static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; \
  1279. \
  1280. static _GLIBCXX_CONSTEXPR unsigned TYPE \
  1281. infinity() _GLIBCXX_USE_NOEXCEPT \
  1282. { return static_cast<unsigned TYPE>(0); } \
  1283. \
  1284. static _GLIBCXX_CONSTEXPR unsigned TYPE \
  1285. quiet_NaN() _GLIBCXX_USE_NOEXCEPT \
  1286. { return static_cast<unsigned TYPE>(0); } \
  1287. \
  1288. static _GLIBCXX_CONSTEXPR unsigned TYPE \
  1289. signaling_NaN() _GLIBCXX_USE_NOEXCEPT \
  1290. { return static_cast<unsigned TYPE>(0); } \
  1291. \
  1292. static _GLIBCXX_CONSTEXPR unsigned TYPE \
  1293. denorm_min() _GLIBCXX_USE_NOEXCEPT \
  1294. { return static_cast<unsigned TYPE>(0); } \
  1295. \
  1296. static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; \
  1297. static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; \
  1298. static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true; \
  1299. \
  1300. static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; \
  1301. static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; \
  1302. static _GLIBCXX_USE_CONSTEXPR float_round_style round_style \
  1303. = round_toward_zero; \
  1304. };
  1305. #if __cplusplus >= 201103L
  1306. #define __INT_N_201103(TYPE) \
  1307. static constexpr TYPE \
  1308. lowest() noexcept { return min(); } \
  1309. static constexpr int max_digits10 = 0;
  1310. #define __INT_N_U201103(TYPE) \
  1311. static constexpr unsigned TYPE \
  1312. lowest() noexcept { return min(); } \
  1313. static constexpr int max_digits10 = 0;
  1314. #else
  1315. #define __INT_N_201103(TYPE)
  1316. #define __INT_N_U201103(TYPE)
  1317. #endif
  1318. #ifdef __GLIBCXX_TYPE_INT_N_0
  1319. __INT_N(__GLIBCXX_TYPE_INT_N_0, __GLIBCXX_BITSIZE_INT_N_0,
  1320. __INT_N_201103 (__GLIBCXX_TYPE_INT_N_0), __INT_N_U201103 (__GLIBCXX_TYPE_INT_N_0))
  1321. #endif
  1322. #ifdef __GLIBCXX_TYPE_INT_N_1
  1323. __INT_N (__GLIBCXX_TYPE_INT_N_1, __GLIBCXX_BITSIZE_INT_N_1,
  1324. __INT_N_201103 (__GLIBCXX_TYPE_INT_N_1), __INT_N_U201103 (__GLIBCXX_TYPE_INT_N_1))
  1325. #endif
  1326. #ifdef __GLIBCXX_TYPE_INT_N_2
  1327. __INT_N (__GLIBCXX_TYPE_INT_N_2, __GLIBCXX_BITSIZE_INT_N_2,
  1328. __INT_N_201103 (__GLIBCXX_TYPE_INT_N_2), __INT_N_U201103 (__GLIBCXX_TYPE_INT_N_2))
  1329. #endif
  1330. #ifdef __GLIBCXX_TYPE_INT_N_3
  1331. __INT_N (__GLIBCXX_TYPE_INT_N_3, __GLIBCXX_BITSIZE_INT_N_3,
  1332. __INT_N_201103 (__GLIBCXX_TYPE_INT_N_3), __INT_N_U201103 (__GLIBCXX_TYPE_INT_N_3))
  1333. #endif
  1334. #undef __INT_N
  1335. #undef __INT_N_201103
  1336. #undef __INT_N_U201103
  1337. #endif
  1338. /// numeric_limits<float> specialization.
  1339. template<>
  1340. struct numeric_limits<float>
  1341. {
  1342. static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
  1343. static _GLIBCXX_CONSTEXPR float
  1344. min() _GLIBCXX_USE_NOEXCEPT { return __FLT_MIN__; }
  1345. static _GLIBCXX_CONSTEXPR float
  1346. max() _GLIBCXX_USE_NOEXCEPT { return __FLT_MAX__; }
  1347. #if __cplusplus >= 201103L
  1348. static constexpr float
  1349. lowest() noexcept { return -__FLT_MAX__; }
  1350. #endif
  1351. static _GLIBCXX_USE_CONSTEXPR int digits = __FLT_MANT_DIG__;
  1352. static _GLIBCXX_USE_CONSTEXPR int digits10 = __FLT_DIG__;
  1353. #if __cplusplus >= 201103L
  1354. static constexpr int max_digits10
  1355. = __glibcxx_max_digits10 (__FLT_MANT_DIG__);
  1356. #endif
  1357. static _GLIBCXX_USE_CONSTEXPR bool is_signed = true;
  1358. static _GLIBCXX_USE_CONSTEXPR bool is_integer = false;
  1359. static _GLIBCXX_USE_CONSTEXPR bool is_exact = false;
  1360. static _GLIBCXX_USE_CONSTEXPR int radix = __FLT_RADIX__;
  1361. static _GLIBCXX_CONSTEXPR float
  1362. epsilon() _GLIBCXX_USE_NOEXCEPT { return __FLT_EPSILON__; }
  1363. static _GLIBCXX_CONSTEXPR float
  1364. round_error() _GLIBCXX_USE_NOEXCEPT { return 0.5F; }
  1365. static _GLIBCXX_USE_CONSTEXPR int min_exponent = __FLT_MIN_EXP__;
  1366. static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = __FLT_MIN_10_EXP__;
  1367. static _GLIBCXX_USE_CONSTEXPR int max_exponent = __FLT_MAX_EXP__;
  1368. static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = __FLT_MAX_10_EXP__;
  1369. static _GLIBCXX_USE_CONSTEXPR bool has_infinity = __FLT_HAS_INFINITY__;
  1370. static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = __FLT_HAS_QUIET_NAN__;
  1371. static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = has_quiet_NaN;
  1372. static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
  1373. = bool(__FLT_HAS_DENORM__) ? denorm_present : denorm_absent;
  1374. static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss
  1375. = __glibcxx_float_has_denorm_loss;
  1376. static _GLIBCXX_CONSTEXPR float
  1377. infinity() _GLIBCXX_USE_NOEXCEPT { return __builtin_huge_valf(); }
  1378. static _GLIBCXX_CONSTEXPR float
  1379. quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return __builtin_nanf(""); }
  1380. static _GLIBCXX_CONSTEXPR float
  1381. signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return __builtin_nansf(""); }
  1382. static _GLIBCXX_CONSTEXPR float
  1383. denorm_min() _GLIBCXX_USE_NOEXCEPT { return __FLT_DENORM_MIN__; }
  1384. static _GLIBCXX_USE_CONSTEXPR bool is_iec559
  1385. = has_infinity && has_quiet_NaN && has_denorm == denorm_present;
  1386. static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
  1387. static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false;
  1388. static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_float_traps;
  1389. static _GLIBCXX_USE_CONSTEXPR bool tinyness_before
  1390. = __glibcxx_float_tinyness_before;
  1391. static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
  1392. = round_to_nearest;
  1393. };
  1394. #undef __glibcxx_float_has_denorm_loss
  1395. #undef __glibcxx_float_traps
  1396. #undef __glibcxx_float_tinyness_before
  1397. /// numeric_limits<double> specialization.
  1398. template<>
  1399. struct numeric_limits<double>
  1400. {
  1401. static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
  1402. static _GLIBCXX_CONSTEXPR double
  1403. min() _GLIBCXX_USE_NOEXCEPT { return __DBL_MIN__; }
  1404. static _GLIBCXX_CONSTEXPR double
  1405. max() _GLIBCXX_USE_NOEXCEPT { return __DBL_MAX__; }
  1406. #if __cplusplus >= 201103L
  1407. static constexpr double
  1408. lowest() noexcept { return -__DBL_MAX__; }
  1409. #endif
  1410. static _GLIBCXX_USE_CONSTEXPR int digits = __DBL_MANT_DIG__;
  1411. static _GLIBCXX_USE_CONSTEXPR int digits10 = __DBL_DIG__;
  1412. #if __cplusplus >= 201103L
  1413. static constexpr int max_digits10
  1414. = __glibcxx_max_digits10 (__DBL_MANT_DIG__);
  1415. #endif
  1416. static _GLIBCXX_USE_CONSTEXPR bool is_signed = true;
  1417. static _GLIBCXX_USE_CONSTEXPR bool is_integer = false;
  1418. static _GLIBCXX_USE_CONSTEXPR bool is_exact = false;
  1419. static _GLIBCXX_USE_CONSTEXPR int radix = __FLT_RADIX__;
  1420. static _GLIBCXX_CONSTEXPR double
  1421. epsilon() _GLIBCXX_USE_NOEXCEPT { return __DBL_EPSILON__; }
  1422. static _GLIBCXX_CONSTEXPR double
  1423. round_error() _GLIBCXX_USE_NOEXCEPT { return 0.5; }
  1424. static _GLIBCXX_USE_CONSTEXPR int min_exponent = __DBL_MIN_EXP__;
  1425. static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = __DBL_MIN_10_EXP__;
  1426. static _GLIBCXX_USE_CONSTEXPR int max_exponent = __DBL_MAX_EXP__;
  1427. static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = __DBL_MAX_10_EXP__;
  1428. static _GLIBCXX_USE_CONSTEXPR bool has_infinity = __DBL_HAS_INFINITY__;
  1429. static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = __DBL_HAS_QUIET_NAN__;
  1430. static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = has_quiet_NaN;
  1431. static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
  1432. = bool(__DBL_HAS_DENORM__) ? denorm_present : denorm_absent;
  1433. static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss
  1434. = __glibcxx_double_has_denorm_loss;
  1435. static _GLIBCXX_CONSTEXPR double
  1436. infinity() _GLIBCXX_USE_NOEXCEPT { return __builtin_huge_val(); }
  1437. static _GLIBCXX_CONSTEXPR double
  1438. quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return __builtin_nan(""); }
  1439. static _GLIBCXX_CONSTEXPR double
  1440. signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return __builtin_nans(""); }
  1441. static _GLIBCXX_CONSTEXPR double
  1442. denorm_min() _GLIBCXX_USE_NOEXCEPT { return __DBL_DENORM_MIN__; }
  1443. static _GLIBCXX_USE_CONSTEXPR bool is_iec559
  1444. = has_infinity && has_quiet_NaN && has_denorm == denorm_present;
  1445. static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
  1446. static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false;
  1447. static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_double_traps;
  1448. static _GLIBCXX_USE_CONSTEXPR bool tinyness_before
  1449. = __glibcxx_double_tinyness_before;
  1450. static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
  1451. = round_to_nearest;
  1452. };
  1453. #undef __glibcxx_double_has_denorm_loss
  1454. #undef __glibcxx_double_traps
  1455. #undef __glibcxx_double_tinyness_before
  1456. /// numeric_limits<long double> specialization.
  1457. template<>
  1458. struct numeric_limits<long double>
  1459. {
  1460. static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
  1461. static _GLIBCXX_CONSTEXPR long double
  1462. min() _GLIBCXX_USE_NOEXCEPT { return __LDBL_MIN__; }
  1463. static _GLIBCXX_CONSTEXPR long double
  1464. max() _GLIBCXX_USE_NOEXCEPT { return __LDBL_MAX__; }
  1465. #if __cplusplus >= 201103L
  1466. static constexpr long double
  1467. lowest() noexcept { return -__LDBL_MAX__; }
  1468. #endif
  1469. static _GLIBCXX_USE_CONSTEXPR int digits = __LDBL_MANT_DIG__;
  1470. static _GLIBCXX_USE_CONSTEXPR int digits10 = __LDBL_DIG__;
  1471. #if __cplusplus >= 201103L
  1472. static _GLIBCXX_USE_CONSTEXPR int max_digits10
  1473. = __glibcxx_max_digits10 (__LDBL_MANT_DIG__);
  1474. #endif
  1475. static _GLIBCXX_USE_CONSTEXPR bool is_signed = true;
  1476. static _GLIBCXX_USE_CONSTEXPR bool is_integer = false;
  1477. static _GLIBCXX_USE_CONSTEXPR bool is_exact = false;
  1478. static _GLIBCXX_USE_CONSTEXPR int radix = __FLT_RADIX__;
  1479. static _GLIBCXX_CONSTEXPR long double
  1480. epsilon() _GLIBCXX_USE_NOEXCEPT { return __LDBL_EPSILON__; }
  1481. static _GLIBCXX_CONSTEXPR long double
  1482. round_error() _GLIBCXX_USE_NOEXCEPT { return 0.5L; }
  1483. static _GLIBCXX_USE_CONSTEXPR int min_exponent = __LDBL_MIN_EXP__;
  1484. static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = __LDBL_MIN_10_EXP__;
  1485. static _GLIBCXX_USE_CONSTEXPR int max_exponent = __LDBL_MAX_EXP__;
  1486. static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = __LDBL_MAX_10_EXP__;
  1487. static _GLIBCXX_USE_CONSTEXPR bool has_infinity = __LDBL_HAS_INFINITY__;
  1488. static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = __LDBL_HAS_QUIET_NAN__;
  1489. static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = has_quiet_NaN;
  1490. static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
  1491. = bool(__LDBL_HAS_DENORM__) ? denorm_present : denorm_absent;
  1492. static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss
  1493. = __glibcxx_long_double_has_denorm_loss;
  1494. static _GLIBCXX_CONSTEXPR long double
  1495. infinity() _GLIBCXX_USE_NOEXCEPT { return __builtin_huge_vall(); }
  1496. static _GLIBCXX_CONSTEXPR long double
  1497. quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return __builtin_nanl(""); }
  1498. static _GLIBCXX_CONSTEXPR long double
  1499. signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return __builtin_nansl(""); }
  1500. static _GLIBCXX_CONSTEXPR long double
  1501. denorm_min() _GLIBCXX_USE_NOEXCEPT { return __LDBL_DENORM_MIN__; }
  1502. static _GLIBCXX_USE_CONSTEXPR bool is_iec559
  1503. = has_infinity && has_quiet_NaN && has_denorm == denorm_present;
  1504. static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
  1505. static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false;
  1506. static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_long_double_traps;
  1507. static _GLIBCXX_USE_CONSTEXPR bool tinyness_before =
  1508. __glibcxx_long_double_tinyness_before;
  1509. static _GLIBCXX_USE_CONSTEXPR float_round_style round_style =
  1510. round_to_nearest;
  1511. };
  1512. #undef __glibcxx_long_double_has_denorm_loss
  1513. #undef __glibcxx_long_double_traps
  1514. #undef __glibcxx_long_double_tinyness_before
  1515. _GLIBCXX_END_NAMESPACE_VERSION
  1516. } // namespace
  1517. #undef __glibcxx_signed
  1518. #undef __glibcxx_min
  1519. #undef __glibcxx_max
  1520. #undef __glibcxx_digits
  1521. #undef __glibcxx_digits10
  1522. #undef __glibcxx_max_digits10
  1523. #endif // _GLIBCXX_NUMERIC_LIMITS