limits.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
  4. <title>Numeric Limits</title>
  5. <link rel="stylesheet" href="../../multiprecision.css" type="text/css">
  6. <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
  7. <link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Boost.Multiprecision">
  8. <link rel="up" href="../tut.html" title="Tutorial">
  9. <link rel="prev" href="serial.html" title="Boost.Serialization Support">
  10. <link rel="next" href="limits/constants.html" title="std::numeric_limits&lt;&gt; constants">
  11. </head>
  12. <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
  13. <table cellpadding="2" width="100%"><tr>
  14. <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
  15. <td align="center"><a href="../../../../../../index.html">Home</a></td>
  16. <td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
  17. <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
  18. <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
  19. <td align="center"><a href="../../../../../../more/index.htm">More</a></td>
  20. </tr></table>
  21. <hr>
  22. <div class="spirit-nav">
  23. <a accesskey="p" href="serial.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../tut.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="limits/constants.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
  24. </div>
  25. <div class="section">
  26. <div class="titlepage"><div><div><h3 class="title">
  27. <a name="boost_multiprecision.tut.limits"></a><a class="link" href="limits.html" title="Numeric Limits">Numeric Limits</a>
  28. </h3></div></div></div>
  29. <div class="toc"><dl class="toc">
  30. <dt><span class="section"><a href="limits/constants.html">std::numeric_limits&lt;&gt;
  31. constants</a></span></dt>
  32. <dt><span class="section"><a href="limits/functions.html"><code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">numeric_limits</span><span class="special">&lt;&gt;</span></code> functions</a></span></dt>
  33. <dt><span class="section"><a href="limits/limits32.html">Numeric limits
  34. for 32-bit platform</a></span></dt>
  35. <dt><span class="section"><a href="limits/how_to_tell.html">How to
  36. Determine the Kind of a Number From <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">numeric_limits</span></code></a></span></dt>
  37. </dl></div>
  38. <p>
  39. Boost.Multiprecision tries hard to implement <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">numeric_limits</span></code>
  40. for all types as far as possible and meaningful because experience with Boost.Math
  41. has shown that this aids portability.
  42. </p>
  43. <p>
  44. The <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3690.pdf" target="_top">C++
  45. standard library</a> defines <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">numeric_limits</span></code>
  46. in section 18.3.2.
  47. </p>
  48. <p>
  49. This in turn refers to the C standard <a href="http://www.open-std.org/jtc1/sc22/wg11/docs/n507.pdf" target="_top">SC22/WG11
  50. N507 DRAFT INTERNATIONAL ISO/IEC STANDARD WD 10967-1</a> Information
  51. technology Language independent arithmetic Part 1: Integer and floating-point
  52. arithmetic.
  53. </p>
  54. <p>
  55. That C Standard in turn refers to
  56. </p>
  57. <p>
  58. <a href="https://doi.org/10.1109/IEEESTD.1985.82928" target="_top">IEEE754 IEEE Standard
  59. for Binary Floating-Point Arithmetic</a>
  60. </p>
  61. <p>
  62. There is a useful summary at <a href="http://www.cplusplus.com/reference/limits/numeric_limits/" target="_top">C++
  63. reference</a>.
  64. </p>
  65. <p>
  66. The chosen backend often determines how completely <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">numeric_limits</span></code>
  67. is available.
  68. </p>
  69. <p>
  70. Compiler options, processor type, and definition of macros or assembler instructions
  71. to control denormal numbers will alter the values in the tables given below.
  72. </p>
  73. <div class="warning"><table border="0" summary="Warning">
  74. <tr>
  75. <td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="../../../../../../doc/src/images/warning.png"></td>
  76. <th align="left">Warning</th>
  77. </tr>
  78. <tr><td align="left" valign="top"><p>
  79. GMP's <code class="computeroutput"><span class="identifier">mpf_t</span></code> does not have
  80. a concept of overflow: operations that lead to overflow eventually run
  81. of out of resources and terminate with stack overflow (often after several
  82. seconds).
  83. </p></td></tr>
  84. </table></div>
  85. </div>
  86. <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
  87. <td align="left"></td>
  88. <td align="right"><div class="copyright-footer">Copyright &#169; 2002-2019 John Maddock
  89. and Christopher Kormanyos<p>
  90. Distributed under the Boost Software License, Version 1.0. (See accompanying
  91. file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
  92. </p>
  93. </div></td>
  94. </tr></table>
  95. <hr>
  96. <div class="spirit-nav">
  97. <a accesskey="p" href="serial.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../tut.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="limits/constants.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
  98. </div>
  99. </body>
  100. </html>