limits 70 KB

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