3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Boost.Integer</title>
5 <link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="index.html" title="Boost.Integer">
8 <link rel="next" href="boost_integer/traits.html" title="Integer Traits">
10 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
11 <table cellpadding="2" width="100%"><tr>
12 <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
13 <td align="center"><a href="../../../../index.html">Home</a></td>
14 <td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
15 <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
16 <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
17 <td align="center"><a href="../../../../more/index.htm">More</a></td>
20 <div class="spirit-nav"><a accesskey="n" href="boost_integer/traits.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a></div>
22 <div class="titlepage">
24 <div><h2 class="title">
25 <a name="boost_integer"></a>Boost.Integer</h2></div>
26 <div><div class="authorgroup">
27 <div class="author"><h3 class="author">
28 <span class="firstname">Beman</span> <span class="surname">Dawes</span>
30 <div class="author"><h3 class="author">
31 <span class="firstname">Daryle</span> <span class="surname">Walker</span>
33 <div class="author"><h3 class="author">
34 <span class="firstname">Gennaro</span> <span class="surname">Prota</span>
36 <div class="author"><h3 class="author">
37 <span class="firstname">John</span> <span class="surname">Maddock</span>
40 <div><p class="copyright">Copyright © 2001-2009 Beman
41 Dawes, Daryle Walker, Gennaro Prota, John Maddock</p></div>
42 <div><div class="legalnotice">
43 <a name="boost_integer.legal"></a><p>
44 Distributed under the Boost Software License, Version 1.0. (See accompanying
45 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>)
52 <p><b>Table of Contents</b></p>
54 <dt><span class="section"><a href="index.html#boost_integer.overview">Overview</a></span></dt>
55 <dt><span class="section"><a href="boost_integer/traits.html">Integer Traits</a></span></dt>
56 <dt><span class="section"><a href="boost_integer/integer.html">Integer Type Selection</a></span></dt>
57 <dt><span class="section"><a href="boost_integer/gcd_lcm.html">Greatest Common Divisor and Least
58 Common Multiple</a></span></dt>
59 <dt><span class="section"><a href="boost_integer/extended_euclidean.html">Extended Euclidean Algorithm</a></span></dt>
60 <dt><span class="section"><a href="boost_integer/mod_inverse.html">Modular Multiplicative Inverse</a></span></dt>
61 <dt><span class="section"><a href="boost_integer/mask.html">Integer Masks</a></span></dt>
62 <dt><span class="section"><a href="boost_integer/log2.html">Compile Time log2 Calculation</a></span></dt>
63 <dt><span class="section"><a href="boost_integer/minmax.html">Compile time min/max calculation</a></span></dt>
64 <dt><span class="section"><a href="boost_integer/history.html">History</a></span></dt>
65 <dt><span class="section"><a href="boost_integer/cstdint.html">Removed from library: Standard Integer
70 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
71 <a name="boost_integer.overview"></a><a class="link" href="index.html#boost_integer.overview" title="Overview">Overview</a>
72 </h2></div></div></div>
74 Boost.Integer provides integer type support, particularly helpful in generic
75 programming. It provides the means to select an integer type based upon its
76 properties, like the number of bits or the maximum supported value, as well
77 as compile-time bit mask selection. There is a derivative of std::numeric_limits
78 that provides integral constant expressions for <code class="computeroutput"><span class="identifier">min</span></code>
79 and <code class="computeroutput"><span class="identifier">max</span></code>. Finally, it provides
80 two compile-time algorithms: determining the highest power of two in a compile-time
81 value; and computing min and max of constant expressions.
83 <div class="informaltable"><table class="table">
110 Forward Declarations.
115 <code class="literal"><a href="../../../../boost/integer_fwd.hpp" target="_top"><boost/integer_fwd.hpp></a></code>
120 Forward declarations of classes and class templates - for use when
121 just the name of a class is needed.
128 <a class="link" href="boost_integer/traits.html" title="Integer Traits">Integer Traits</a>.
133 <code class="literal"><a href="../../../../boost/integer_traits.hpp" target="_top"><boost/integer_traits.hpp></a></code>
138 Class template <code class="literal">boost::integer_traits</code>, derives
139 from <code class="literal">std::numeric_limits</code> and adds <code class="literal">const_min</code>
140 and <code class="literal">const_max</code> members.
147 <a class="link" href="boost_integer/integer.html" title="Integer Type Selection">Integer Type Selection</a>.
152 <code class="literal"><a href="../../../../boost/integer.hpp" target="_top"><boost/integer.hpp></a></code>
157 Templates for integer type selection based on properties such as
158 maximum value or number of bits: Use to select the type of an integer
159 when some property such as maximum value or number of bits is known.
160 Useful for generic programming.
167 <a class="link" href="boost_integer/gcd_lcm.html" title="Greatest Common Divisor and Least Common Multiple">Greatest Common Divisor and
168 Least Common Multiple</a>.
173 <code class="literal"><a href="../../../../boost/integer/common_factor_rt.hpp" target="_top"><boost/integer/common_factor_rt.hpp></a></code>
174 and <code class="literal"><a href="../../../../boost/integer/common_factor_ct.hpp" target="_top"><boost/integer/common_factor_ct.hpp></a></code>
179 Functions <code class="computeroutput"><span class="identifier">gcd</span></code> and
180 <code class="computeroutput"><span class="identifier">lcm</span></code> plus function
181 objects and compile time versions.
188 <a class="link" href="boost_integer/mask.html" title="Integer Masks">Integer Masks</a>.
193 <code class="literal"><a href="../../../../boost/integer/integer_mask.hpp" target="_top"><boost/integer/integer_mask.hpp></a></code>
198 Templates for the selection of integer masks, single or lowest group,
199 based on the number of bits: Use to select a particular mask when
200 the bit position(s) are based on a compile-time variable. Useful
201 for generic programming.
208 <a class="link" href="boost_integer/log2.html" title="Compile Time log2 Calculation">Compile time log2 Calculation</a>.
213 <code class="literal"><a href="../../../../boost/integer/static_log2.hpp" target="_top"><boost/integer/static_log2.hpp></a></code>
218 Template for finding the highest power of two in a number: Use to
219 find the bit-size/range based on a maximum value. Useful for generic
227 <a class="link" href="boost_integer/minmax.html" title="Compile time min/max calculation">Compile time min/max calculation</a>.
232 <code class="literal"><a href="../../../../boost/integer/static_min_max.hpp" target="_top"><boost/integer/static_min_max.hpp></a></code>
237 Templates for finding the extrema of two numbers: Use to find a bound
238 based on a minimum or maximum value. Useful for generic programming.
245 <a class="link" href="boost_integer/extended_euclidean.html" title="Extended Euclidean Algorithm">Extended Euclidean
251 <code class="literal"><a href="../../../../boost/integer/extended_euclidean.hpp" target="_top"><boost/integer/extended_euclidean.hpp></a></code>
256 Solves <span class="emphasis"><em>mx + ny = gcd(x,y)</em></span> for <span class="emphasis"><em>x</em></span>
257 and <span class="emphasis"><em>y</em></span>.
264 <a class="link" href="boost_integer/mod_inverse.html" title="Modular Multiplicative Inverse">Modular multiplicative
270 <code class="literal"><a href="../../../../boost/integer/mod_inverse.hpp" target="_top"><boost/integer/mod_inverse.hpp></a></code>
275 Given <span class="emphasis"><em>a</em></span> and <span class="emphasis"><em>m</em></span>, solves
276 <span class="emphasis"><em>ax</em></span> = 1 mod <span class="emphasis"><em>m</em></span> for <span class="emphasis"><em>x</em></span>.
284 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
285 <td align="left"><p><small>Last revised: December 10, 2019 at 00:22:42 GMT</small></p></td>
286 <td align="right"><div class="copyright-footer"></div></td>
289 <div class="spirit-nav"><a accesskey="n" href="boost_integer/traits.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a></div>