Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r76433 - in sandbox/big_number: boost/multiprecision libs/multiprecision/doc libs/multiprecision/doc/html libs/multiprecision/doc/html/boost_multiprecision libs/multiprecision/doc/html/boost_multiprecision/map libs/multiprecision/doc/html/boost_multiprecision/ref libs/multiprecision/doc/html/boost_multiprecision/tut libs/multiprecision/example libs/multiprecision/performance libs/multiprecision/test
From: john_at_[hidden]
Date: 2012-01-12 08:56:24


Author: johnmaddock
Date: 2012-01-12 08:56:22 EST (Thu, 12 Jan 2012)
New Revision: 76433
URL: http://svn.boost.org/trac/boost/changeset/76433

Log:
Update docs to include fixed_int.hpp.
Remove 64-bit versions of fixed_int typedefs - better to use boost::int64_t instead.
Added:
   sandbox/big_number/libs/multiprecision/example/fixed_int_snips.cpp (contents, props changed)
Text files modified:
   sandbox/big_number/boost/multiprecision/fixed_int.hpp | 2
   sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/intro.html | 2
   sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/map.html | 2
   sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/map/hist.html | 2
   sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/map/todo.html | 2
   sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/ref.html | 2
   sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/ref/backendconc.html | 2
   sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/ref/mp_number.html | 2
   sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut.html | 2
   sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/ints.html | 87 +++++++++++++++++++++++++++++++++++++++
   sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/rational.html | 2
   sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/reals.html | 2
   sandbox/big_number/libs/multiprecision/doc/html/index.html | 2
   sandbox/big_number/libs/multiprecision/doc/multiprecision.qbk | 29 +++++++++++++
   sandbox/big_number/libs/multiprecision/performance/performance_test.cpp | 2
   sandbox/big_number/libs/multiprecision/test/test_arithmetic.cpp | 2
   sandbox/big_number/libs/multiprecision/test/test_int_io.cpp | 4
   17 files changed, 130 insertions(+), 18 deletions(-)

Modified: sandbox/big_number/boost/multiprecision/fixed_int.hpp
==============================================================================
--- sandbox/big_number/boost/multiprecision/fixed_int.hpp (original)
+++ sandbox/big_number/boost/multiprecision/fixed_int.hpp 2012-01-12 08:56:22 EST (Thu, 12 Jan 2012)
@@ -1034,12 +1034,10 @@
 template <unsigned Bits, bool Signed>
 struct number_category<fixed_int<Bits, Signed> > : public mpl::int_<number_kind_integer>{};
 
-typedef mp_number<fixed_int<64, false> > mp_uint64_t;
 typedef mp_number<fixed_int<128, false> > mp_uint128_t;
 typedef mp_number<fixed_int<256, false> > mp_uint256_t;
 typedef mp_number<fixed_int<512, false> > mp_uint512_t;
 
-typedef mp_number<fixed_int<64, true> > mp_int64_t;
 typedef mp_number<fixed_int<128, true> > mp_int128_t;
 typedef mp_number<fixed_int<256, true> > mp_int256_t;
 typedef mp_number<fixed_int<512, true> > mp_int512_t;

Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/intro.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/intro.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/intro.html 2012-01-12 08:56:22 EST (Thu, 12 Jan 2012)
@@ -13,7 +13,7 @@
 <div class="spirit-nav">
 <a accesskey="p" href="../index.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="tut.html"><img src="../images/next.png" alt="Next"></a>
 </div>
-<div class="section">
+<div class="section boost_multiprecision_intro">
 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
 <a name="boost_multiprecision.intro"></a><a class="link" href="intro.html" title="Introduction">Introduction</a>
 </h2></div></div></div>

Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/map.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/map.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/map.html 2012-01-12 08:56:22 EST (Thu, 12 Jan 2012)
@@ -13,7 +13,7 @@
 <div class="spirit-nav">
 <a accesskey="p" href="ref/backendconc.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="map/hist.html"><img src="../images/next.png" alt="Next"></a>
 </div>
-<div class="section">
+<div class="section boost_multiprecision_map">
 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
 <a name="boost_multiprecision.map"></a><a class="link" href="map.html" title="Roadmap">Roadmap</a>
 </h2></div></div></div>

Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/map/hist.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/map/hist.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/map/hist.html 2012-01-12 08:56:22 EST (Thu, 12 Jan 2012)
@@ -13,7 +13,7 @@
 <div class="spirit-nav">
 <a accesskey="p" href="../map.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../map.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="todo.html"><img src="../../images/next.png" alt="Next"></a>
 </div>
-<div class="section"><div class="titlepage"><div><div><h3 class="title">
+<div class="section boost_multiprecision_map_hist"><div class="titlepage"><div><div><h3 class="title">
 <a name="boost_multiprecision.map.hist"></a><a class="link" href="hist.html" title="History">History</a>
 </h3></div></div></div></div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>

Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/map/todo.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/map/todo.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/map/todo.html 2012-01-12 08:56:22 EST (Thu, 12 Jan 2012)
@@ -12,7 +12,7 @@
 <div class="spirit-nav">
 <a accesskey="p" href="hist.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../map.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a>
 </div>
-<div class="section">
+<div class="section boost_multiprecision_map_todo">
 <div class="titlepage"><div><div><h3 class="title">
 <a name="boost_multiprecision.map.todo"></a><a class="link" href="todo.html" title="TODO">TODO</a>
 </h3></div></div></div>

Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/ref.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/ref.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/ref.html 2012-01-12 08:56:22 EST (Thu, 12 Jan 2012)
@@ -13,7 +13,7 @@
 <div class="spirit-nav">
 <a accesskey="p" href="tut/rational.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="ref/mp_number.html"><img src="../images/next.png" alt="Next"></a>
 </div>
-<div class="section">
+<div class="section boost_multiprecision_ref">
 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
 <a name="boost_multiprecision.ref"></a><a class="link" href="ref.html" title="Reference">Reference</a>
 </h2></div></div></div>

Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/ref/backendconc.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/ref/backendconc.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/ref/backendconc.html 2012-01-12 08:56:22 EST (Thu, 12 Jan 2012)
@@ -13,7 +13,7 @@
 <div class="spirit-nav">
 <a accesskey="p" href="mp_number.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="../map.html"><img src="../../images/next.png" alt="Next"></a>
 </div>
-<div class="section">
+<div class="section boost_multiprecision_ref_backendconc">
 <div class="titlepage"><div><div><h3 class="title">
 <a name="boost_multiprecision.ref.backendconc"></a><a class="link" href="backendconc.html" title="Backend Requirements">Backend Requirements</a>
 </h3></div></div></div>

Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/ref/mp_number.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/ref/mp_number.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/ref/mp_number.html 2012-01-12 08:56:22 EST (Thu, 12 Jan 2012)
@@ -13,7 +13,7 @@
 <div class="spirit-nav">
 <a accesskey="p" href="../ref.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="backendconc.html"><img src="../../images/next.png" alt="Next"></a>
 </div>
-<div class="section">
+<div class="section boost_multiprecision_ref_mp_number">
 <div class="titlepage"><div><div><h3 class="title">
 <a name="boost_multiprecision.ref.mp_number"></a><a class="link" href="mp_number.html" title="mp_number">mp_number</a>
 </h3></div></div></div>

Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut.html 2012-01-12 08:56:22 EST (Thu, 12 Jan 2012)
@@ -13,7 +13,7 @@
 <div class="spirit-nav">
 <a accesskey="p" href="intro.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="tut/ints.html"><img src="../images/next.png" alt="Next"></a>
 </div>
-<div class="section">
+<div class="section boost_multiprecision_tut">
 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
 <a name="boost_multiprecision.tut"></a><a class="link" href="tut.html" title="Tutorial">Tutorial</a>
 </h2></div></div></div>

Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/ints.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/ints.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/ints.html 2012-01-12 08:56:22 EST (Thu, 12 Jan 2012)
@@ -13,7 +13,7 @@
 <div class="spirit-nav">
 <a accesskey="p" href="../tut.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../tut.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="reals.html"><img src="../../images/next.png" alt="Next"></a>
 </div>
-<div class="section">
+<div class="section boost_multiprecision_tut_ints">
 <div class="titlepage"><div><div><h3 class="title">
 <a name="boost_multiprecision.tut.ints"></a><a class="link" href="ints.html" title="Integer Types">Integer Types</a>
 </h3></div></div></div>
@@ -126,6 +126,38 @@
                 </p>
               </td>
 </tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">fixed_int</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ boost/multiprecision/fixed_int.hpp
+ </p>
+ </td>
+<td>
+ <p>
+ 2
+ </p>
+ </td>
+<td>
+ <p>
+ None
+ </p>
+ </td>
+<td>
+ <p>
+ Boost licenced fixed precision modular arithmetic integer.
+ </p>
+ </td>
+<td>
+ <p>
+ Slower than GMP.
+ </p>
+ </td>
+</tr>
 </tbody>
 </table></div>
 <h5>
@@ -289,6 +321,59 @@
 </pre>
 <p>
       </p>
+<h5>
+<a name="boost_multiprecision.tut.ints.h4"></a>
+ <span><a name="boost_multiprecision.tut.ints.fixed_int"></a></span><a class="link" href="ints.html#boost_multiprecision.tut.ints.fixed_int">fixed_int</a>
+ </h5>
+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">multiprecision</span><span class="special">{</span>
+
+<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">unsigned</span> <span class="identifier">Digits</span><span class="special">,</span> <span class="keyword">bool</span> <span class="identifier">Signed</span><span class="special">&gt;</span>
+<span class="keyword">class</span> <span class="identifier">fixed_int</span><span class="special">;</span>
+
+<span class="keyword">typedef</span> <span class="identifier">mp_number</span><span class="special">&lt;</span><span class="identifier">fixed_int</span><span class="special">&lt;</span><span class="number">128</span><span class="special">,</span> <span class="keyword">false</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">mp_uint128_t</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">mp_number</span><span class="special">&lt;</span><span class="identifier">fixed_int</span><span class="special">&lt;</span><span class="number">256</span><span class="special">,</span> <span class="keyword">false</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">mp_uint256_t</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">mp_number</span><span class="special">&lt;</span><span class="identifier">fixed_int</span><span class="special">&lt;</span><span class="number">512</span><span class="special">,</span> <span class="keyword">false</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">mp_uint512_t</span><span class="special">;</span>
+
+<span class="keyword">typedef</span> <span class="identifier">mp_number</span><span class="special">&lt;</span><span class="identifier">fixed_int</span><span class="special">&lt;</span><span class="number">128</span><span class="special">,</span> <span class="keyword">true</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">mp_int128_t</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">mp_number</span><span class="special">&lt;</span><span class="identifier">fixed_int</span><span class="special">&lt;</span><span class="number">256</span><span class="special">,</span> <span class="keyword">true</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">mp_int256_t</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">mp_number</span><span class="special">&lt;</span><span class="identifier">fixed_int</span><span class="special">&lt;</span><span class="number">512</span><span class="special">,</span> <span class="keyword">true</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">mp_int512_t</span><span class="special">;</span>
+
+<span class="special">}}</span> <span class="comment">// namespaces</span>
+</pre>
+<p>
+ The <code class="computeroutput"><span class="identifier">fixed_int</span></code> backend is
+ used via one of the typedefs <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">multiprecision</span><span class="special">::</span><span class="identifier">mp_uint128_t</span></code>,
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">multiprecision</span><span class="special">::</span><span class="identifier">mp_uint256_t</span></code>, <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">multiprecision</span><span class="special">::</span><span class="identifier">mp_uint512_t</span></code>,
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">multiprecision</span><span class="special">::</span><span class="identifier">mp_int128_t</span></code>, <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">multiprecision</span><span class="special">::</span><span class="identifier">mp_int256_t</span></code>
+ or <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">multiprecision</span><span class="special">::</span><span class="identifier">mp_int512_t</span></code>. It provides both signed and
+ unsigned integer types with a fixed precision and modular arithmetic with
+ a 2's complement representation for negative values. In other words it's
+ designed to work just like a typical built in integer type, but with larger
+ precision.
+ </p>
+<h6>
+<a name="boost_multiprecision.tut.ints.h5"></a>
+ <span><a name="boost_multiprecision.tut.ints.example1"></a></span><a class="link" href="ints.html#boost_multiprecision.tut.ints.example1">Example:</a>
+ </h6>
+<p>
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">multiprecision</span><span class="special">/</span><span class="identifier">fixed_int</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">multiprecision</span><span class="special">;</span>
+
+<span class="identifier">mp_int128_t</span> <span class="identifier">v</span> <span class="special">=</span> <span class="number">1</span><span class="special">;</span>
+
+<span class="comment">// Do some arithmetic:</span>
+<span class="keyword">for</span><span class="special">(</span><span class="keyword">unsigned</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">1</span><span class="special">;</span> <span class="identifier">i</span> <span class="special">&lt;=</span> <span class="number">20</span><span class="special">;</span> <span class="special">++</span><span class="identifier">i</span><span class="special">)</span>
+ <span class="identifier">v</span> <span class="special">*=</span> <span class="identifier">i</span><span class="special">;</span>
+
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">v</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> <span class="comment">// prints 20!</span>
+<span class="identifier">v</span> <span class="special">=</span> <span class="special">-</span><span class="identifier">v</span><span class="special">;</span>
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">hex</span> <span class="special">&lt;&lt;</span> <span class="identifier">v</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> <span class="comment">// prints 2's complement representation</span>
+
+</pre>
+<p>
+ </p>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
 <td align="left"></td>

Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/rational.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/rational.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/rational.html 2012-01-12 08:56:22 EST (Thu, 12 Jan 2012)
@@ -13,7 +13,7 @@
 <div class="spirit-nav">
 <a accesskey="p" href="reals.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../tut.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="../ref.html"><img src="../../images/next.png" alt="Next"></a>
 </div>
-<div class="section">
+<div class="section boost_multiprecision_tut_rational">
 <div class="titlepage"><div><div><h3 class="title">
 <a name="boost_multiprecision.tut.rational"></a><a class="link" href="rational.html" title="Rational Number Types">Rational Number Types</a>
 </h3></div></div></div>

Modified: sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/reals.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/reals.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/boost_multiprecision/tut/reals.html 2012-01-12 08:56:22 EST (Thu, 12 Jan 2012)
@@ -13,7 +13,7 @@
 <div class="spirit-nav">
 <a accesskey="p" href="ints.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../tut.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="rational.html"><img src="../../images/next.png" alt="Next"></a>
 </div>
-<div class="section">
+<div class="section boost_multiprecision_tut_reals">
 <div class="titlepage"><div><div><h3 class="title">
 <a name="boost_multiprecision.tut.reals"></a><a class="link" href="reals.html" title="Real Numbers">Real Numbers</a>
 </h3></div></div></div>

Modified: sandbox/big_number/libs/multiprecision/doc/html/index.html
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/html/index.html (original)
+++ sandbox/big_number/libs/multiprecision/doc/html/index.html 2012-01-12 08:56:22 EST (Thu, 12 Jan 2012)
@@ -48,7 +48,7 @@
 </div>
 </div>
 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"><p><small>Last revised: December 24, 2011 at 13:13:53 GMT</small></p></td>
+<td align="left"><p><small>Last revised: January 12, 2012 at 13:44:32 GMT</small></p></td>
 <td align="right"><div class="copyright-footer"></div></td>
 </tr></table>
 <hr>

Modified: sandbox/big_number/libs/multiprecision/doc/multiprecision.qbk
==============================================================================
--- sandbox/big_number/libs/multiprecision/doc/multiprecision.qbk (original)
+++ sandbox/big_number/libs/multiprecision/doc/multiprecision.qbk 2012-01-12 08:56:22 EST (Thu, 12 Jan 2012)
@@ -22,6 +22,7 @@
 [import ../example/mpfr_snips.cpp]
 [import ../example/cpp_float_snips.cpp]
 [import ../example/tommath_snips.cpp]
+[import ../example/fixed_int_snips.cpp]
 
 [section:intro Introduction]
 
@@ -201,6 +202,7 @@
 [[Backend Type][Header][Radix][Dependencies][Pros][Cons]]
 [[`gmp_int`][boost/multiprecision/gmp.hpp][2][GMP][Very fast and efficient backend.][Dependency on GNU licenced GMP library.]]
 [[`mp_int`][boost/multiprecision/tommath.hpp][2][libtommath][Public domain backend with no licence restrictions.][Slower than GMP.]]
+[[`fixed_int`][boost/multiprecision/fixed_int.hpp][2][None][Boost licenced fixed precision modular arithmetic integer.][Slower than GMP.]]
 ]
 
 [h4 gmp_int]
@@ -257,6 +259,33 @@
 
 [tommath_eg]
 
+[h4 fixed_int]
+
+ namespace boost{ namespace multiprecision{
+
+ template <unsigned Digits, bool Signed>
+ class fixed_int;
+
+ typedef mp_number<fixed_int<128, false> > mp_uint128_t;
+ typedef mp_number<fixed_int<256, false> > mp_uint256_t;
+ typedef mp_number<fixed_int<512, false> > mp_uint512_t;
+
+ typedef mp_number<fixed_int<128, true> > mp_int128_t;
+ typedef mp_number<fixed_int<256, true> > mp_int256_t;
+ typedef mp_number<fixed_int<512, true> > mp_int512_t;
+
+ }} // namespaces
+
+The `fixed_int` backend is used via one of the typedefs `boost::multiprecision::mp_uint128_t`, `boost::multiprecision::mp_uint256_t`,
+`boost::multiprecision::mp_uint512_t`, `boost::multiprecision::mp_int128_t`, `boost::multiprecision::mp_int256_t`
+or `boost::multiprecision::mp_int512_t`. It provides both signed and unsigned integer types with a fixed precision
+and modular arithmetic with a 2's complement representation for negative values. In other words it's designed to work just
+like a typical built in integer type, but with larger precision.
+
+[h5 Example:]
+
+[fixed_int_eg]
+
 [endsect]
 
 [section:reals Real Numbers]

Added: sandbox/big_number/libs/multiprecision/example/fixed_int_snips.cpp
==============================================================================
--- (empty file)
+++ sandbox/big_number/libs/multiprecision/example/fixed_int_snips.cpp 2012-01-12 08:56:22 EST (Thu, 12 Jan 2012)
@@ -0,0 +1,34 @@
+///////////////////////////////////////////////////////////////
+// Copyright 2011 John Maddock. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_
+
+#include <boost/multiprecision/fixed_int.hpp>
+#include <iostream>
+
+void t1()
+{
+ //[fixed_int_eg
+ //=#include <boost/multiprecision/fixed_int.hpp>
+
+ using namespace boost::multiprecision;
+
+ mp_int128_t v = 1;
+
+ // Do some arithmetic:
+ for(unsigned i = 1; i <= 20; ++i)
+ v *= i;
+
+ std::cout << v << std::endl; // prints 20!
+ v = -v;
+ std::cout << std::hex << v << std::endl; // prints 2's complement representation
+
+ //]
+}
+
+int main()
+{
+ t1();
+ return 0;
+}
+

Modified: sandbox/big_number/libs/multiprecision/performance/performance_test.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/performance/performance_test.cpp (original)
+++ sandbox/big_number/libs/multiprecision/performance/performance_test.cpp 2012-01-12 08:56:22 EST (Thu, 12 Jan 2012)
@@ -348,7 +348,7 @@
    test<boost::multiprecision::mp_int>("tommath_int", 1024);
 #endif
 #ifdef TEST_FIXED_INT
- test<boost::multiprecision::mp_int64_t>("mp_int64_t", 64);
+ test<boost::multiprecision::mp_number<boost::multiprecision::fixed_int<64, true> > >("mp_int64_t", 64);
    test<boost::multiprecision::mp_int128_t>("mp_int128_t", 128);
    test<boost::multiprecision::mp_int256_t>("mp_int256_t", 256);
    test<boost::multiprecision::mp_int512_t>("mp_int512_t", 512);

Modified: sandbox/big_number/libs/multiprecision/test/test_arithmetic.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/test_arithmetic.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/test_arithmetic.cpp 2012-01-12 08:56:22 EST (Thu, 12 Jan 2012)
@@ -1000,7 +1000,7 @@
    test<boost::rational<boost::multiprecision::mpz_int> >();
 #endif
 #ifdef TEST_FIXED_INT1
- test<boost::multiprecision::mp_uint64_t>();
+ test<boost::multiprecision::mp_number<boost::multiprecision::fixed_int<64, false> > >();
    test<boost::multiprecision::mp_uint128_t>();
    test<boost::multiprecision::mp_uint512_t>();
    test<boost::multiprecision::mp_number<boost::multiprecision::fixed_int<70, false> > >();

Modified: sandbox/big_number/libs/multiprecision/test/test_int_io.cpp
==============================================================================
--- sandbox/big_number/libs/multiprecision/test/test_int_io.cpp (original)
+++ sandbox/big_number/libs/multiprecision/test/test_int_io.cpp 2012-01-12 08:56:22 EST (Thu, 12 Jan 2012)
@@ -124,14 +124,14 @@
    test_round_trip<boost::multiprecision::mp_int>();
 #endif
 #ifdef TEST_FIXED_INT1
- test_round_trip<boost::multiprecision::mp_uint64_t>();
+ test_round_trip<boost::multiprecision::mp_number<boost::multiprecision::fixed_int<64, false> > >();
    test_round_trip<boost::multiprecision::mp_uint128_t>();
    test_round_trip<boost::multiprecision::mp_uint512_t>();
    test_round_trip<boost::multiprecision::mp_number<boost::multiprecision::fixed_int<20, false> > >();
    test_round_trip<boost::multiprecision::mp_number<boost::multiprecision::fixed_int<70, false> > >();
 #endif
 #ifdef TEST_FIXED_INT2
- test_round_trip<boost::multiprecision::mp_int64_t>();
+ test_round_trip<boost::multiprecision::mp_number<boost::multiprecision::fixed_int<64, true> > >();
    test_round_trip<boost::multiprecision::mp_int128_t>();
    test_round_trip<boost::multiprecision::mp_int512_t>();
    test_round_trip<boost::multiprecision::mp_number<boost::multiprecision::fixed_int<20, true> > >();


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk