limits 70 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903
  1. // The template and inlines for the numeric_limits classes. -*- C++ -*-
  2. // Copyright (C) 1999-2022 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. #define __INT_N(TYPE, BITSIZE, EXT, UEXT) \
  1170. __extension__ \
  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. __extension__ \
  1240. template<> \
  1241. struct numeric_limits<unsigned TYPE> \
  1242. { \
  1243. static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true; \
  1244. \
  1245. static _GLIBCXX_CONSTEXPR unsigned TYPE \
  1246. min() _GLIBCXX_USE_NOEXCEPT { return 0; } \
  1247. \
  1248. static _GLIBCXX_CONSTEXPR unsigned TYPE \
  1249. max() _GLIBCXX_USE_NOEXCEPT \
  1250. { return __glibcxx_max_b (unsigned TYPE, BITSIZE); } \
  1251. \
  1252. UEXT \
  1253. \
  1254. static _GLIBCXX_USE_CONSTEXPR int digits \
  1255. = BITSIZE; \
  1256. static _GLIBCXX_USE_CONSTEXPR int digits10 \
  1257. = BITSIZE * 643L / 2136; \
  1258. static _GLIBCXX_USE_CONSTEXPR bool is_signed = false; \
  1259. static _GLIBCXX_USE_CONSTEXPR bool is_integer = true; \
  1260. static _GLIBCXX_USE_CONSTEXPR bool is_exact = true; \
  1261. static _GLIBCXX_USE_CONSTEXPR int radix = 2; \
  1262. \
  1263. static _GLIBCXX_CONSTEXPR unsigned TYPE \
  1264. epsilon() _GLIBCXX_USE_NOEXCEPT { return 0; } \
  1265. \
  1266. static _GLIBCXX_CONSTEXPR unsigned TYPE \
  1267. round_error() _GLIBCXX_USE_NOEXCEPT { return 0; } \
  1268. \
  1269. static _GLIBCXX_USE_CONSTEXPR int min_exponent = 0; \
  1270. static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = 0; \
  1271. static _GLIBCXX_USE_CONSTEXPR int max_exponent = 0; \
  1272. static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = 0; \
  1273. \
  1274. static _GLIBCXX_USE_CONSTEXPR bool has_infinity = false; \
  1275. static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = false; \
  1276. static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = false; \
  1277. static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm \
  1278. = denorm_absent; \
  1279. static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss = false; \
  1280. \
  1281. static _GLIBCXX_CONSTEXPR unsigned TYPE \
  1282. infinity() _GLIBCXX_USE_NOEXCEPT \
  1283. { return static_cast<unsigned TYPE>(0); } \
  1284. \
  1285. static _GLIBCXX_CONSTEXPR unsigned TYPE \
  1286. quiet_NaN() _GLIBCXX_USE_NOEXCEPT \
  1287. { return static_cast<unsigned TYPE>(0); } \
  1288. \
  1289. static _GLIBCXX_CONSTEXPR unsigned TYPE \
  1290. signaling_NaN() _GLIBCXX_USE_NOEXCEPT \
  1291. { return static_cast<unsigned TYPE>(0); } \
  1292. \
  1293. static _GLIBCXX_CONSTEXPR unsigned TYPE \
  1294. denorm_min() _GLIBCXX_USE_NOEXCEPT \
  1295. { return static_cast<unsigned TYPE>(0); } \
  1296. \
  1297. static _GLIBCXX_USE_CONSTEXPR bool is_iec559 = false; \
  1298. static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true; \
  1299. static _GLIBCXX_USE_CONSTEXPR bool is_modulo = true; \
  1300. \
  1301. static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_integral_traps; \
  1302. static _GLIBCXX_USE_CONSTEXPR bool tinyness_before = false; \
  1303. static _GLIBCXX_USE_CONSTEXPR float_round_style round_style \
  1304. = round_toward_zero; \
  1305. };
  1306. #if __cplusplus >= 201103L
  1307. #define __INT_N_201103(TYPE) \
  1308. static constexpr TYPE \
  1309. lowest() noexcept { return min(); } \
  1310. static constexpr int max_digits10 = 0;
  1311. #define __INT_N_U201103(TYPE) \
  1312. static constexpr unsigned TYPE \
  1313. lowest() noexcept { return min(); } \
  1314. static constexpr int max_digits10 = 0;
  1315. #else
  1316. #define __INT_N_201103(TYPE)
  1317. #define __INT_N_U201103(TYPE)
  1318. #endif
  1319. #if !defined(__STRICT_ANSI__)
  1320. #ifdef __GLIBCXX_TYPE_INT_N_0
  1321. __INT_N(__GLIBCXX_TYPE_INT_N_0, __GLIBCXX_BITSIZE_INT_N_0,
  1322. __INT_N_201103 (__GLIBCXX_TYPE_INT_N_0),
  1323. __INT_N_U201103 (__GLIBCXX_TYPE_INT_N_0))
  1324. #endif
  1325. #ifdef __GLIBCXX_TYPE_INT_N_1
  1326. __INT_N (__GLIBCXX_TYPE_INT_N_1, __GLIBCXX_BITSIZE_INT_N_1,
  1327. __INT_N_201103 (__GLIBCXX_TYPE_INT_N_1),
  1328. __INT_N_U201103 (__GLIBCXX_TYPE_INT_N_1))
  1329. #endif
  1330. #ifdef __GLIBCXX_TYPE_INT_N_2
  1331. __INT_N (__GLIBCXX_TYPE_INT_N_2, __GLIBCXX_BITSIZE_INT_N_2,
  1332. __INT_N_201103 (__GLIBCXX_TYPE_INT_N_2),
  1333. __INT_N_U201103 (__GLIBCXX_TYPE_INT_N_2))
  1334. #endif
  1335. #ifdef __GLIBCXX_TYPE_INT_N_3
  1336. __INT_N (__GLIBCXX_TYPE_INT_N_3, __GLIBCXX_BITSIZE_INT_N_3,
  1337. __INT_N_201103 (__GLIBCXX_TYPE_INT_N_3),
  1338. __INT_N_U201103 (__GLIBCXX_TYPE_INT_N_3))
  1339. #endif
  1340. #elif defined __STRICT_ANSI__ && defined __SIZEOF_INT128__
  1341. __INT_N(__int128, 128,
  1342. __INT_N_201103 (__int128),
  1343. __INT_N_U201103 (__int128))
  1344. #endif
  1345. #undef __INT_N
  1346. #undef __INT_N_201103
  1347. #undef __INT_N_U201103
  1348. /// numeric_limits<float> specialization.
  1349. template<>
  1350. struct numeric_limits<float>
  1351. {
  1352. static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
  1353. static _GLIBCXX_CONSTEXPR float
  1354. min() _GLIBCXX_USE_NOEXCEPT { return __FLT_MIN__; }
  1355. static _GLIBCXX_CONSTEXPR float
  1356. max() _GLIBCXX_USE_NOEXCEPT { return __FLT_MAX__; }
  1357. #if __cplusplus >= 201103L
  1358. static constexpr float
  1359. lowest() noexcept { return -__FLT_MAX__; }
  1360. #endif
  1361. static _GLIBCXX_USE_CONSTEXPR int digits = __FLT_MANT_DIG__;
  1362. static _GLIBCXX_USE_CONSTEXPR int digits10 = __FLT_DIG__;
  1363. #if __cplusplus >= 201103L
  1364. static constexpr int max_digits10
  1365. = __glibcxx_max_digits10 (__FLT_MANT_DIG__);
  1366. #endif
  1367. static _GLIBCXX_USE_CONSTEXPR bool is_signed = true;
  1368. static _GLIBCXX_USE_CONSTEXPR bool is_integer = false;
  1369. static _GLIBCXX_USE_CONSTEXPR bool is_exact = false;
  1370. static _GLIBCXX_USE_CONSTEXPR int radix = __FLT_RADIX__;
  1371. static _GLIBCXX_CONSTEXPR float
  1372. epsilon() _GLIBCXX_USE_NOEXCEPT { return __FLT_EPSILON__; }
  1373. static _GLIBCXX_CONSTEXPR float
  1374. round_error() _GLIBCXX_USE_NOEXCEPT { return 0.5F; }
  1375. static _GLIBCXX_USE_CONSTEXPR int min_exponent = __FLT_MIN_EXP__;
  1376. static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = __FLT_MIN_10_EXP__;
  1377. static _GLIBCXX_USE_CONSTEXPR int max_exponent = __FLT_MAX_EXP__;
  1378. static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = __FLT_MAX_10_EXP__;
  1379. static _GLIBCXX_USE_CONSTEXPR bool has_infinity = __FLT_HAS_INFINITY__;
  1380. static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = __FLT_HAS_QUIET_NAN__;
  1381. static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = has_quiet_NaN;
  1382. static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
  1383. = bool(__FLT_HAS_DENORM__) ? denorm_present : denorm_absent;
  1384. static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss
  1385. = __glibcxx_float_has_denorm_loss;
  1386. static _GLIBCXX_CONSTEXPR float
  1387. infinity() _GLIBCXX_USE_NOEXCEPT { return __builtin_huge_valf(); }
  1388. static _GLIBCXX_CONSTEXPR float
  1389. quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return __builtin_nanf(""); }
  1390. static _GLIBCXX_CONSTEXPR float
  1391. signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return __builtin_nansf(""); }
  1392. static _GLIBCXX_CONSTEXPR float
  1393. denorm_min() _GLIBCXX_USE_NOEXCEPT { return __FLT_DENORM_MIN__; }
  1394. static _GLIBCXX_USE_CONSTEXPR bool is_iec559
  1395. = has_infinity && has_quiet_NaN && has_denorm == denorm_present;
  1396. static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
  1397. static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false;
  1398. static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_float_traps;
  1399. static _GLIBCXX_USE_CONSTEXPR bool tinyness_before
  1400. = __glibcxx_float_tinyness_before;
  1401. static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
  1402. = round_to_nearest;
  1403. };
  1404. #undef __glibcxx_float_has_denorm_loss
  1405. #undef __glibcxx_float_traps
  1406. #undef __glibcxx_float_tinyness_before
  1407. /// numeric_limits<double> specialization.
  1408. template<>
  1409. struct numeric_limits<double>
  1410. {
  1411. static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
  1412. static _GLIBCXX_CONSTEXPR double
  1413. min() _GLIBCXX_USE_NOEXCEPT { return __DBL_MIN__; }
  1414. static _GLIBCXX_CONSTEXPR double
  1415. max() _GLIBCXX_USE_NOEXCEPT { return __DBL_MAX__; }
  1416. #if __cplusplus >= 201103L
  1417. static constexpr double
  1418. lowest() noexcept { return -__DBL_MAX__; }
  1419. #endif
  1420. static _GLIBCXX_USE_CONSTEXPR int digits = __DBL_MANT_DIG__;
  1421. static _GLIBCXX_USE_CONSTEXPR int digits10 = __DBL_DIG__;
  1422. #if __cplusplus >= 201103L
  1423. static constexpr int max_digits10
  1424. = __glibcxx_max_digits10 (__DBL_MANT_DIG__);
  1425. #endif
  1426. static _GLIBCXX_USE_CONSTEXPR bool is_signed = true;
  1427. static _GLIBCXX_USE_CONSTEXPR bool is_integer = false;
  1428. static _GLIBCXX_USE_CONSTEXPR bool is_exact = false;
  1429. static _GLIBCXX_USE_CONSTEXPR int radix = __FLT_RADIX__;
  1430. static _GLIBCXX_CONSTEXPR double
  1431. epsilon() _GLIBCXX_USE_NOEXCEPT { return __DBL_EPSILON__; }
  1432. static _GLIBCXX_CONSTEXPR double
  1433. round_error() _GLIBCXX_USE_NOEXCEPT { return 0.5; }
  1434. static _GLIBCXX_USE_CONSTEXPR int min_exponent = __DBL_MIN_EXP__;
  1435. static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = __DBL_MIN_10_EXP__;
  1436. static _GLIBCXX_USE_CONSTEXPR int max_exponent = __DBL_MAX_EXP__;
  1437. static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = __DBL_MAX_10_EXP__;
  1438. static _GLIBCXX_USE_CONSTEXPR bool has_infinity = __DBL_HAS_INFINITY__;
  1439. static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = __DBL_HAS_QUIET_NAN__;
  1440. static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = has_quiet_NaN;
  1441. static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
  1442. = bool(__DBL_HAS_DENORM__) ? denorm_present : denorm_absent;
  1443. static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss
  1444. = __glibcxx_double_has_denorm_loss;
  1445. static _GLIBCXX_CONSTEXPR double
  1446. infinity() _GLIBCXX_USE_NOEXCEPT { return __builtin_huge_val(); }
  1447. static _GLIBCXX_CONSTEXPR double
  1448. quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return __builtin_nan(""); }
  1449. static _GLIBCXX_CONSTEXPR double
  1450. signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return __builtin_nans(""); }
  1451. static _GLIBCXX_CONSTEXPR double
  1452. denorm_min() _GLIBCXX_USE_NOEXCEPT { return __DBL_DENORM_MIN__; }
  1453. static _GLIBCXX_USE_CONSTEXPR bool is_iec559
  1454. = has_infinity && has_quiet_NaN && has_denorm == denorm_present;
  1455. static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
  1456. static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false;
  1457. static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_double_traps;
  1458. static _GLIBCXX_USE_CONSTEXPR bool tinyness_before
  1459. = __glibcxx_double_tinyness_before;
  1460. static _GLIBCXX_USE_CONSTEXPR float_round_style round_style
  1461. = round_to_nearest;
  1462. };
  1463. #undef __glibcxx_double_has_denorm_loss
  1464. #undef __glibcxx_double_traps
  1465. #undef __glibcxx_double_tinyness_before
  1466. /// numeric_limits<long double> specialization.
  1467. template<>
  1468. struct numeric_limits<long double>
  1469. {
  1470. static _GLIBCXX_USE_CONSTEXPR bool is_specialized = true;
  1471. static _GLIBCXX_CONSTEXPR long double
  1472. min() _GLIBCXX_USE_NOEXCEPT { return __LDBL_MIN__; }
  1473. static _GLIBCXX_CONSTEXPR long double
  1474. max() _GLIBCXX_USE_NOEXCEPT { return __LDBL_MAX__; }
  1475. #if __cplusplus >= 201103L
  1476. static constexpr long double
  1477. lowest() noexcept { return -__LDBL_MAX__; }
  1478. #endif
  1479. static _GLIBCXX_USE_CONSTEXPR int digits = __LDBL_MANT_DIG__;
  1480. static _GLIBCXX_USE_CONSTEXPR int digits10 = __LDBL_DIG__;
  1481. #if __cplusplus >= 201103L
  1482. static _GLIBCXX_USE_CONSTEXPR int max_digits10
  1483. = __glibcxx_max_digits10 (__LDBL_MANT_DIG__);
  1484. #endif
  1485. static _GLIBCXX_USE_CONSTEXPR bool is_signed = true;
  1486. static _GLIBCXX_USE_CONSTEXPR bool is_integer = false;
  1487. static _GLIBCXX_USE_CONSTEXPR bool is_exact = false;
  1488. static _GLIBCXX_USE_CONSTEXPR int radix = __FLT_RADIX__;
  1489. static _GLIBCXX_CONSTEXPR long double
  1490. epsilon() _GLIBCXX_USE_NOEXCEPT { return __LDBL_EPSILON__; }
  1491. static _GLIBCXX_CONSTEXPR long double
  1492. round_error() _GLIBCXX_USE_NOEXCEPT { return 0.5L; }
  1493. static _GLIBCXX_USE_CONSTEXPR int min_exponent = __LDBL_MIN_EXP__;
  1494. static _GLIBCXX_USE_CONSTEXPR int min_exponent10 = __LDBL_MIN_10_EXP__;
  1495. static _GLIBCXX_USE_CONSTEXPR int max_exponent = __LDBL_MAX_EXP__;
  1496. static _GLIBCXX_USE_CONSTEXPR int max_exponent10 = __LDBL_MAX_10_EXP__;
  1497. static _GLIBCXX_USE_CONSTEXPR bool has_infinity = __LDBL_HAS_INFINITY__;
  1498. static _GLIBCXX_USE_CONSTEXPR bool has_quiet_NaN = __LDBL_HAS_QUIET_NAN__;
  1499. static _GLIBCXX_USE_CONSTEXPR bool has_signaling_NaN = has_quiet_NaN;
  1500. static _GLIBCXX_USE_CONSTEXPR float_denorm_style has_denorm
  1501. = bool(__LDBL_HAS_DENORM__) ? denorm_present : denorm_absent;
  1502. static _GLIBCXX_USE_CONSTEXPR bool has_denorm_loss
  1503. = __glibcxx_long_double_has_denorm_loss;
  1504. static _GLIBCXX_CONSTEXPR long double
  1505. infinity() _GLIBCXX_USE_NOEXCEPT { return __builtin_huge_vall(); }
  1506. static _GLIBCXX_CONSTEXPR long double
  1507. quiet_NaN() _GLIBCXX_USE_NOEXCEPT { return __builtin_nanl(""); }
  1508. static _GLIBCXX_CONSTEXPR long double
  1509. signaling_NaN() _GLIBCXX_USE_NOEXCEPT { return __builtin_nansl(""); }
  1510. static _GLIBCXX_CONSTEXPR long double
  1511. denorm_min() _GLIBCXX_USE_NOEXCEPT { return __LDBL_DENORM_MIN__; }
  1512. static _GLIBCXX_USE_CONSTEXPR bool is_iec559
  1513. = has_infinity && has_quiet_NaN && has_denorm == denorm_present;
  1514. static _GLIBCXX_USE_CONSTEXPR bool is_bounded = true;
  1515. static _GLIBCXX_USE_CONSTEXPR bool is_modulo = false;
  1516. static _GLIBCXX_USE_CONSTEXPR bool traps = __glibcxx_long_double_traps;
  1517. static _GLIBCXX_USE_CONSTEXPR bool tinyness_before =
  1518. __glibcxx_long_double_tinyness_before;
  1519. static _GLIBCXX_USE_CONSTEXPR float_round_style round_style =
  1520. round_to_nearest;
  1521. };
  1522. #undef __glibcxx_long_double_has_denorm_loss
  1523. #undef __glibcxx_long_double_traps
  1524. #undef __glibcxx_long_double_tinyness_before
  1525. _GLIBCXX_END_NAMESPACE_VERSION
  1526. } // namespace
  1527. #undef __glibcxx_signed
  1528. #undef __glibcxx_min
  1529. #undef __glibcxx_max
  1530. #undef __glibcxx_digits
  1531. #undef __glibcxx_digits10
  1532. #undef __glibcxx_max_digits10
  1533. #endif // _GLIBCXX_NUMERIC_LIMITS