1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 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"> 9</head> 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> 18</tr></table> 19<hr> 20<div class="spirit-nav"><a accesskey="n" href="boost_integer/traits.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a></div> 21<div class="article"> 22<div class="titlepage"> 23<div> 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> 29</h3></div> 30<div class="author"><h3 class="author"> 31<span class="firstname">Daryle</span> <span class="surname">Walker</span> 32</h3></div> 33<div class="author"><h3 class="author"> 34<span class="firstname">Gennaro</span> <span class="surname">Prota</span> 35</h3></div> 36<div class="author"><h3 class="author"> 37<span class="firstname">John</span> <span class="surname">Maddock</span> 38</h3></div> 39</div></div> 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>) 46 </p> 47</div></div> 48</div> 49<hr> 50</div> 51<div class="toc"> 52<p><b>Table of Contents</b></p> 53<dl class="toc"> 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 66 Types</a></span></dt> 67</dl> 68</div> 69<div class="section"> 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> 73<p> 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. 82 </p> 83<div class="informaltable"><table class="table"> 84<colgroup> 85<col> 86<col> 87<col> 88</colgroup> 89<thead><tr> 90<th> 91 <p> 92 Component 93 </p> 94 </th> 95<th> 96 <p> 97 Header 98 </p> 99 </th> 100<th> 101 <p> 102 Purpose 103 </p> 104 </th> 105</tr></thead> 106<tbody> 107<tr> 108<td> 109 <p> 110 Forward Declarations. 111 </p> 112 </td> 113<td> 114 <p> 115 <code class="literal"><a href="../../../../boost/integer_fwd.hpp" target="_top"><boost/integer_fwd.hpp></a></code> 116 </p> 117 </td> 118<td> 119 <p> 120 Forward declarations of classes and class templates - for use when 121 just the name of a class is needed. 122 </p> 123 </td> 124</tr> 125<tr> 126<td> 127 <p> 128 <a class="link" href="boost_integer/traits.html" title="Integer Traits">Integer Traits</a>. 129 </p> 130 </td> 131<td> 132 <p> 133 <code class="literal"><a href="../../../../boost/integer_traits.hpp" target="_top"><boost/integer_traits.hpp></a></code> 134 </p> 135 </td> 136<td> 137 <p> 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. 141 </p> 142 </td> 143</tr> 144<tr> 145<td> 146 <p> 147 <a class="link" href="boost_integer/integer.html" title="Integer Type Selection">Integer Type Selection</a>. 148 </p> 149 </td> 150<td> 151 <p> 152 <code class="literal"><a href="../../../../boost/integer.hpp" target="_top"><boost/integer.hpp></a></code> 153 </p> 154 </td> 155<td> 156 <p> 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. 161 </p> 162 </td> 163</tr> 164<tr> 165<td> 166 <p> 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>. 169 </p> 170 </td> 171<td> 172 <p> 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> 175 </p> 176 </td> 177<td> 178 <p> 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. 182 </p> 183 </td> 184</tr> 185<tr> 186<td> 187 <p> 188 <a class="link" href="boost_integer/mask.html" title="Integer Masks">Integer Masks</a>. 189 </p> 190 </td> 191<td> 192 <p> 193 <code class="literal"><a href="../../../../boost/integer/integer_mask.hpp" target="_top"><boost/integer/integer_mask.hpp></a></code> 194 </p> 195 </td> 196<td> 197 <p> 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. 202 </p> 203 </td> 204</tr> 205<tr> 206<td> 207 <p> 208 <a class="link" href="boost_integer/log2.html" title="Compile Time log2 Calculation">Compile time log2 Calculation</a>. 209 </p> 210 </td> 211<td> 212 <p> 213 <code class="literal"><a href="../../../../boost/integer/static_log2.hpp" target="_top"><boost/integer/static_log2.hpp></a></code> 214 </p> 215 </td> 216<td> 217 <p> 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 220 programming. 221 </p> 222 </td> 223</tr> 224<tr> 225<td> 226 <p> 227 <a class="link" href="boost_integer/minmax.html" title="Compile time min/max calculation">Compile time min/max calculation</a>. 228 </p> 229 </td> 230<td> 231 <p> 232 <code class="literal"><a href="../../../../boost/integer/static_min_max.hpp" target="_top"><boost/integer/static_min_max.hpp></a></code> 233 </p> 234 </td> 235<td> 236 <p> 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. 239 </p> 240 </td> 241</tr> 242<tr> 243<td> 244 <p> 245 <a class="link" href="boost_integer/extended_euclidean.html" title="Extended Euclidean Algorithm">Extended Euclidean 246 algorithm</a>. 247 </p> 248 </td> 249<td> 250 <p> 251 <code class="literal"><a href="../../../../boost/integer/extended_euclidean.hpp" target="_top"><boost/integer/extended_euclidean.hpp></a></code> 252 </p> 253 </td> 254<td> 255 <p> 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>. 258 </p> 259 </td> 260</tr> 261<tr> 262<td> 263 <p> 264 <a class="link" href="boost_integer/mod_inverse.html" title="Modular Multiplicative Inverse">Modular multiplicative 265 inverse</a>. 266 </p> 267 </td> 268<td> 269 <p> 270 <code class="literal"><a href="../../../../boost/integer/mod_inverse.hpp" target="_top"><boost/integer/mod_inverse.hpp></a></code> 271 </p> 272 </td> 273<td> 274 <p> 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>. 277 </p> 278 </td> 279</tr> 280</tbody> 281</table></div> 282</div> 283</div> 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: August 11, 2020 at 15:00:14 GMT</small></p></td> 286<td align="right"><div class="copyright-footer"></div></td> 287</tr></table> 288<hr> 289<div class="spirit-nav"><a accesskey="n" href="boost_integer/traits.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a></div> 290</body> 291</html> 292