Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64446 - in sandbox/SOC/2010/bits_and_ints/libs/integer: doc doc/html doc/html/boost_integer example test
From: muriloufg_at_[hidden]
Date: 2010-07-29 11:29:56


Author: murilov
Date: 2010-07-29 11:29:53 EDT (Thu, 29 Jul 2010)
New Revision: 64446
URL: http://svn.boost.org/trac/boost/changeset/64446

Log:
Added documentation and examples for Rotate functions
Added:
   sandbox/SOC/2010/bits_and_ints/libs/integer/example/rotate_example.cpp (contents, props changed)
Text files modified:
   sandbox/SOC/2010/bits_and_ints/libs/integer/doc/bits_and_ints.qbk | 116 ++++++++++++++++++++++
   sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/boost_integer/bits_and_ints.html | 207 +++++++++++++++++++++++++++++++++++++++
   sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/boost_integer/history.html | 4
   sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/index.html | 2
   sandbox/SOC/2010/bits_and_ints/libs/integer/test/Jamfile.v2 | 1
   5 files changed, 322 insertions(+), 8 deletions(-)

Modified: sandbox/SOC/2010/bits_and_ints/libs/integer/doc/bits_and_ints.qbk
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/libs/integer/doc/bits_and_ints.qbk (original)
+++ sandbox/SOC/2010/bits_and_ints/libs/integer/doc/bits_and_ints.qbk 2010-07-29 11:29:53 EDT (Thu, 29 Jul 2010)
@@ -365,6 +365,62 @@
 
 [endsect]
 
+[section Find First One String of a Given Length]
+The header file [@../../../../boost/integer/find_first_one_string.hpp <boost/integer/find_first_one_string.hpp>] defines
+`find_first_one_string` function wich returns the index of start position of a consecutive string of ones with
+at least a given length.
+
+[section Synopsis]
+ template <typename T, typename Policy>
+ int find_first_one_string(T value, unsigned size, const Policy& pol);
+
+ template <typename T>
+ int find_first_one_string(T value, unsigned size);
+[endsect]
+
+*[*Remarks: ] `size` must be greater than 0 and less than the size in bits of the type `T`. If this constraint is not met,
+a `math::policies::domain_error` is raised.
+*[*Returns: ] The index of the first string of ones with at least `size` length, if this string is not found,
+-1 is returned. The index starts at most significant bit (0). The least significant bit is size of `T` in bits minus one.
+
+[section Examples]
+``
+#include <iostream>
+#include <boost/assert.hpp>
+#include <boost/integer/find_first_one_string.hpp>
+
+int main()
+{
+ using namespace boost;
+
+ // v
+ // 1111 0000 1111 1111 0000 0000 0000 0000
+ BOOST_ASSERT((find_first_one_string(0xF0FF0000u, 6) == 8));
+
+ // Not found a string of consecutive ones with legth at least 20
+ BOOST_ASSERT((find_first_one_string(0xF0FF0000u, 20) == -1));
+
+ // v
+ // 0000 0000 0000 0000 0000 0000 0000 0010
+ BOOST_ASSERT((find_first_one_string(0x00000002u, 1) == 30));
+
+ // v
+ // 0000 0000 0000 0000 0000 0000 0000 0011
+ BOOST_ASSERT((find_first_one_string(0x00000003u, 1) == 30));
+
+ // v
+ // 0000 0000 0000 0000 0000 0000 0000 0001
+ BOOST_ASSERT((find_first_one_string(0x00000001u, 1) == 31));
+
+ // v
+ // 0001 0010 0011 0100 0111 0000 0000 0010
+ BOOST_ASSERT((find_first_one_string(0x12347002u, 3) == 17));
+}
+``
+[endsect]
+
+[endsect]
+
 [section Greatest Common Divisor ]
 The header file [@../../../../boost/integer/static_gcd.hpp <boost/integer/static_gcd.hpp>] defines `mpl::gcd<>`
 metafunction wich calculates the greatest common divisor of two given `mpl::integral_c<>`.
@@ -396,11 +452,11 @@
         
 [endsect]
 
-*[*Remarks: ] If `value` is 0, the result is [*undefined].
+*[*Remarks: ] If `value` is 0, an `math::policy::undefined_result_error` is raised, see section Examples for more information.
 *[*Requires: ] `T` to be an integral type.
 *[*Returns: ] The integer logarithm in base 2 of `value` rounded down or -1 if `value` is equal to 0.
 *[*Throws: ] `ilog2` raises an `undeterminate_result_error` if `value` is 0, and by default do not throw anything, but is
-possible to change the behaviour using Boost Math's policies. See section Examples.
+possible to change the behavior using Boost Math's policies. See section Examples.
 
 [section Examples]
 
@@ -519,6 +575,48 @@
 
 [endsect]
 
+[section Rotate Shifts]
+The header [@../../../../boost/integer/rotate.hpp <boost/integer/rotate.hpp>] defines Rotating shifts
+or [@http://en.wikipedia.org/wiki/Circular_shift Circular shifts] functions.
+
+[section Synopsis]
+ inline T rotate_left(T value, unsigned length);
+ inline T rotate_right(T value, unsigned length);
+[endsect]
+
+*[*Requires: ] `T` to be an integral type.
+*[*Remarks: ] `length` must be less than the size in bits of `T`.
+*[*Returns: ] `value` rotated `length` bits to the left or to right.
+
+[section Examples]
+[@../../../../libs/integer/example/rotate_example.cpp Rotate functions example]
+
+``
+#include <boost/assert.hpp>
+#include <boost/integer/rotate.hpp>
+
+int main()
+{
+ using boost::rotate_left;
+ using boost::rotate_right;
+
+ BOOST_ASSERT((rotate_left(0xABCDEF12u, 24) == 0x12ABCDEFu));
+ BOOST_ASSERT((rotate_left(0x12345678u, 4) == 0x23456781u));
+ BOOST_ASSERT((rotate_left(0x0FF00000u, 6) == 0xFC000003u));
+ BOOST_ASSERT((rotate_left(0x00000000u, 31) == 0x00000000u));
+ BOOST_ASSERT((rotate_left(0xF0F0F0F0u, 4) == 0x0F0F0F0Fu));
+
+ BOOST_ASSERT((rotate_right(0xABCDEF12u, 8) == 0x12ABCDEFu));
+ BOOST_ASSERT((rotate_right(0x0000000Fu, 1) == 0x80000007u));
+ BOOST_ASSERT((rotate_right(0xFF00FF00u, 8) == 0x00FF00FFu));
+ BOOST_ASSERT((rotate_right(0xAABBCCDDu, 16) == 0xCCDDAABBu));
+ BOOST_ASSERT((rotate_right(0xFFFFFFFFu, 31) == 0xFFFFFFFFu));
+}
+``
+[endsect]
+
+[endsect]
+
 [section Round to Power of 2 functions]
 This function rounds up and down positive integral values to the next power of 2.
 The `ceil_pow2` function rounds up and `floor_pow2` function rounds down.
@@ -829,6 +927,20 @@
 [endsect]
 [endsect]
 
+[section (Integral) Square Root]
+The header file [@../../../../boost/integer/isqrt.hpp <boost/integer/isqrt.hpp>] defines `isqrt`
+functions wich computes the integral part of square root of integral values.
+
+[section Synopsis]
+ int isqrt(uint8_t value);
+ int isqrt(uint16_t value);
+ int isqrt(uint32_t value);
+[endsect]
+
+*[*Returns: ] The square root of `value` rounded down.
+
+[endsect]
+
 [section Swap without a temporary (in-place) ]
 The header file [@../../../../boost/integer/swap_in_place.hpp <boost/integer/swap_in_place.hpp>] defines `swap_in_place`
 function wich swaps 2 integral values without using a temporary variable.

Modified: sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/boost_integer/bits_and_ints.html
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/boost_integer/bits_and_ints.html (original)
+++ sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/boost_integer/bits_and_ints.html 2010-07-29 11:29:53 EDT (Thu, 29 Jul 2010)
@@ -39,6 +39,8 @@
       Leading Zeros</a></span></dt>
 <dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.count_trailing_zeros">Count
       Trailing Zeros</a></span></dt>
+<dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.find_first_one_string_of_a_given_length">Find
+ First One String of a Given Length</a></span></dt>
 <dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.greatest_common_divisor_">Greatest
       Common Divisor </a></span></dt>
 <dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.integer_logarithm_base_2__ilog2_function__">Integer
@@ -49,12 +51,15 @@
       Common Multiple </a></span></dt>
 <dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.population_count__count_bits_set_">Population
       Count (count bits set)</a></span></dt>
+<dt><span class="section">Rotate Shifts</span></dt>
 <dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.round_to_power_of_2_functions">Round
       to Power of 2 functions</a></span></dt>
 <dt><span class="section">Safe Average</span></dt>
 <dt><span class="section"> Same Sign</span></dt>
 <dt><span class="section"> Sign Extending</span></dt>
 <dt><span class="section"> Sign section</span></dt>
+<dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints._integral__square_root">(Integral)
+ Square Root</a></span></dt>
 <dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.swap_without_a_temporary__in_place__">Swap
       without a temporary (in-place) </a></span></dt>
 <dt><span class="section"><a href="bits_and_ints.html#boost_integer.bits_and_ints.transfer_of_sign__isign__functions_">Transfer
@@ -753,6 +758,99 @@
         </li>
 </ul></div>
 </div>
+<div class="section" title="Find First One String of a Given Length">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_integer.bits_and_ints.find_first_one_string_of_a_given_length"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.find_first_one_string_of_a_given_length" title="Find First One String of a Given Length">Find
+ First One String of a Given Length</a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Synopsis</span></dt>
+<dt><span class="section">Examples</span></dt>
+</dl></div>
+<p>
+ The header file <boost/integer/find_first_one_string.hpp>
+ defines <code class="computeroutput"><span class="identifier">find_first_one_string</span></code>
+ function wich returns the index of start position of a consecutive string
+ of ones with at least a given length.
+ </p>
+<div class="section" title="Synopsis">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_integer.bits_and_ints.find_first_one_string_of_a_given_length.synopsis"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.find_first_one_string_of_a_given_length.synopsis" title="Synopsis">Synopsis</a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Policy</span><span class="special">&gt;</span>
+<span class="keyword">int</span> <span class="identifier">find_first_one_string</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">value</span><span class="special">,</span> <span class="keyword">unsigned</span> <span class="identifier">size</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Policy</span><span class="special">&amp;</span> <span class="identifier">pol</span><span class="special">);</span>
+
+<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">int</span> <span class="identifier">find_first_one_string</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">value</span><span class="special">,</span> <span class="keyword">unsigned</span> <span class="identifier">size</span><span class="special">);</span>
+</pre>
+<p>
+ template &lt;typename T, typename Policy&gt; int find_first_one_string(T
+ value, unsigned size, const Policy&amp; pol);
+ </p>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">&gt;</span>
+<span class="keyword">int</span> <span class="identifier">find_first_one_string</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">value</span><span class="special">,</span> <span class="keyword">unsigned</span> <span class="identifier">size</span><span class="special">);</span>
+</pre>
+<p>
+ template &lt;typename T&gt; int find_first_one_string(T value, unsigned
+ size);
+ </p>
+</div>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+<span class="bold"><strong>Remarks: </strong></span><code class="computeroutput"><span class="identifier">size</span></code>
+ must be greater than 0 and less than the size in bits of the type <code class="computeroutput"><span class="identifier">T</span></code>. If this constraint is not met, a
+ <code class="computeroutput"><span class="identifier">math</span><span class="special">::</span><span class="identifier">policies</span><span class="special">::</span><span class="identifier">domain_error</span></code> is raised.
+ </li>
+<li class="listitem">
+<span class="bold"><strong>Returns: </strong></span> The index of the first string
+ of ones with at least <code class="computeroutput"><span class="identifier">size</span></code>
+ length, if this string is not found, -1 is returned. The index starts at
+ most significant bit (0). The least significant bit is size of <code class="computeroutput"><span class="identifier">T</span></code> in bits minus one.
+ </li>
+</ul></div>
+<div class="section" title="Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_integer.bits_and_ints.find_first_one_string_of_a_given_length.examples"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.find_first_one_string_of_a_given_length.examples" title="Examples">Examples</a>
+</h4></div></div></div>
+<p>
+
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">iostream</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">assert</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">integer</span><span class="special">/</span><span class="identifier">find_first_one_string</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">;</span>
+
+ <span class="comment">// v
+</span> <span class="comment">// 1111 0000 1111 1111 0000 0000 0000 0000
+</span> <span class="identifier">BOOST_ASSERT</span><span class="special">((</span><span class="identifier">find_first_one_string</span><span class="special">(</span><span class="number">0xF0FF0000u</span><span class="special">,</span> <span class="number">6</span><span class="special">)</span> <span class="special">==</span> <span class="number">8</span><span class="special">));</span>
+
+ <span class="comment">// Not found a string of consecutive ones with legth at least 20
+</span> <span class="identifier">BOOST_ASSERT</span><span class="special">((</span><span class="identifier">find_first_one_string</span><span class="special">(</span><span class="number">0xF0FF0000u</span><span class="special">,</span> <span class="number">20</span><span class="special">)</span> <span class="special">==</span> <span class="special">-</span><span class="number">1</span><span class="special">));</span>
+
+ <span class="comment">// v
+</span> <span class="comment">// 0000 0000 0000 0000 0000 0000 0000 0010
+</span> <span class="identifier">BOOST_ASSERT</span><span class="special">((</span><span class="identifier">find_first_one_string</span><span class="special">(</span><span class="number">0x00000002u</span><span class="special">,</span> <span class="number">1</span><span class="special">)</span> <span class="special">==</span> <span class="number">30</span><span class="special">));</span>
+
+ <span class="comment">// v
+</span> <span class="comment">// 0000 0000 0000 0000 0000 0000 0000 0011
+</span> <span class="identifier">BOOST_ASSERT</span><span class="special">((</span><span class="identifier">find_first_one_string</span><span class="special">(</span><span class="number">0x00000003u</span><span class="special">,</span> <span class="number">1</span><span class="special">)</span> <span class="special">==</span> <span class="number">30</span><span class="special">));</span>
+
+ <span class="comment">// v
+</span> <span class="comment">// 0000 0000 0000 0000 0000 0000 0000 0001
+</span> <span class="identifier">BOOST_ASSERT</span><span class="special">((</span><span class="identifier">find_first_one_string</span><span class="special">(</span><span class="number">0x00000001u</span><span class="special">,</span> <span class="number">1</span><span class="special">)</span> <span class="special">==</span> <span class="number">31</span><span class="special">));</span>
+
+ <span class="comment">// v
+</span> <span class="comment">// 0001 0010 0011 0100 0111 0000 0000 0010
+</span> <span class="identifier">BOOST_ASSERT</span><span class="special">((</span><span class="identifier">find_first_one_string</span><span class="special">(</span><span class="number">0x12347002u</span><span class="special">,</span> <span class="number">3</span><span class="special">)</span> <span class="special">==</span> <span class="number">17</span><span class="special">));</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+</div>
+</div>
 <div class="section" title="Greatest Common Divisor">
 <div class="titlepage"><div><div><h3 class="title">
 <a name="boost_integer.bits_and_ints.greatest_common_divisor_"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.greatest_common_divisor_" title="Greatest Common Divisor">Greatest
@@ -813,7 +911,8 @@
 <div class="itemizedlist"><ul class="itemizedlist" type="disc">
 <li class="listitem">
 <span class="bold"><strong>Remarks: </strong></span> If <code class="computeroutput"><span class="identifier">value</span></code>
- is 0, the result is <span class="bold"><strong>undefined</strong></span>.
+ is 0, an <code class="computeroutput"><span class="identifier">math</span><span class="special">::</span><span class="identifier">policy</span><span class="special">::</span><span class="identifier">undefined_result_error</span></code> is raised, see
+ section Examples for more information.
         </li>
 <li class="listitem">
 <span class="bold"><strong>Requires: </strong></span><code class="computeroutput"><span class="identifier">T</span></code>
@@ -829,7 +928,7 @@
 <span class="bold"><strong>Throws: </strong></span><code class="computeroutput"><span class="identifier">ilog2</span></code>
           raises an <code class="computeroutput"><span class="identifier">undeterminate_result_error</span></code>
           if <code class="computeroutput"><span class="identifier">value</span></code> is 0, and by default
- do not throw anything, but is possible to change the behaviour using Boost
+ do not throw anything, but is possible to change the behavior using Boost
           Math's policies. See section Examples.
         </li>
 </ul></div>
@@ -999,6 +1098,82 @@
         </li>
 </ul></div>
 </div>
+<div class="section" title="Rotate Shifts">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_integer.bits_and_ints.rotate_shifts"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.rotate_shifts" title="Rotate Shifts">Rotate Shifts</a>
+</h3></div></div></div>
+<div class="toc"><dl>
+<dt><span class="section">Synopsis</span></dt>
+<dt><span class="section">Examples</span></dt>
+</dl></div>
+<p>
+ The header <boost/integer/rotate.hpp>
+ defines Rotating shifts or <a href="http://en.wikipedia.org/wiki/Circular_shift" target="_top">Circular
+ shifts</a> functions.
+ </p>
+<div class="section" title="Synopsis">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_integer.bits_and_ints.rotate_shifts.synopsis"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.rotate_shifts.synopsis" title="Synopsis">Synopsis</a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">inline</span> <span class="identifier">T</span> <span class="identifier">rotate_left</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">value</span><span class="special">,</span> <span class="keyword">unsigned</span> <span class="identifier">length</span><span class="special">);</span>
+<span class="keyword">inline</span> <span class="identifier">T</span> <span class="identifier">rotate_right</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">value</span><span class="special">,</span> <span class="keyword">unsigned</span> <span class="identifier">length</span><span class="special">);</span>
+</pre>
+<p>
+ inline T rotate_left(T value, unsigned length); inline T rotate_right(T
+ value, unsigned length);
+ </p>
+</div>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc">
+<li class="listitem">
+<span class="bold"><strong>Requires: </strong></span><code class="computeroutput"><span class="identifier">T</span></code>
+ to be an integral type.
+ </li>
+<li class="listitem">
+<span class="bold"><strong>Remarks: </strong></span><code class="computeroutput"><span class="identifier">length</span></code>
+ must be less than the size in bits of <code class="computeroutput"><span class="identifier">T</span></code>.
+ </li>
+<li class="listitem">
+<span class="bold"><strong>Returns: </strong></span><code class="computeroutput"><span class="identifier">value</span></code>
+ rotated <code class="computeroutput"><span class="identifier">length</span></code> bits to
+ the left or to right.
+ </li>
+</ul></div>
+<div class="section" title="Examples">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_integer.bits_and_ints.rotate_shifts.examples"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.rotate_shifts.examples" title="Examples">Examples</a>
+</h4></div></div></div>
+<p>
+ <a href="../../../../../libs/integer/example/rotate_example.cpp" target="_top">Rotate
+ functions example</a>
+ </p>
+<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">assert</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">integer</span><span class="special">/</span><span class="identifier">rotate</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
+<span class="special">{</span>
+ <span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">rotate_left</span><span class="special">;</span>
+ <span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">rotate_right</span><span class="special">;</span>
+
+ <span class="identifier">BOOST_ASSERT</span><span class="special">((</span><span class="identifier">rotate_left</span><span class="special">(</span><span class="number">0xABCDEF12u</span><span class="special">,</span> <span class="number">24</span><span class="special">)</span> <span class="special">==</span> <span class="number">0x12ABCDEFu</span><span class="special">));</span>
+ <span class="identifier">BOOST_ASSERT</span><span class="special">((</span><span class="identifier">rotate_left</span><span class="special">(</span><span class="number">0x12345678u</span><span class="special">,</span> <span class="number">4</span><span class="special">)</span> <span class="special">==</span> <span class="number">0x23456781u</span><span class="special">));</span>
+ <span class="identifier">BOOST_ASSERT</span><span class="special">((</span><span class="identifier">rotate_left</span><span class="special">(</span><span class="number">0x0FF00000u</span><span class="special">,</span> <span class="number">6</span><span class="special">)</span> <span class="special">==</span> <span class="number">0xFC000003u</span><span class="special">));</span>
+ <span class="identifier">BOOST_ASSERT</span><span class="special">((</span><span class="identifier">rotate_left</span><span class="special">(</span><span class="number">0x00000000u</span><span class="special">,</span> <span class="number">31</span><span class="special">)</span> <span class="special">==</span> <span class="number">0x00000000u</span><span class="special">));</span>
+ <span class="identifier">BOOST_ASSERT</span><span class="special">((</span><span class="identifier">rotate_left</span><span class="special">(</span><span class="number">0xF0F0F0F0u</span><span class="special">,</span> <span class="number">4</span><span class="special">)</span> <span class="special">==</span> <span class="number">0x0F0F0F0Fu</span><span class="special">));</span>
+
+ <span class="identifier">BOOST_ASSERT</span><span class="special">((</span><span class="identifier">rotate_right</span><span class="special">(</span><span class="number">0xABCDEF12u</span><span class="special">,</span> <span class="number">8</span><span class="special">)</span> <span class="special">==</span> <span class="number">0x12ABCDEFu</span><span class="special">));</span>
+ <span class="identifier">BOOST_ASSERT</span><span class="special">((</span><span class="identifier">rotate_right</span><span class="special">(</span><span class="number">0x0000000Fu</span><span class="special">,</span> <span class="number">1</span><span class="special">)</span> <span class="special">==</span> <span class="number">0x80000007u</span><span class="special">));</span>
+ <span class="identifier">BOOST_ASSERT</span><span class="special">((</span><span class="identifier">rotate_right</span><span class="special">(</span><span class="number">0xFF00FF00u</span><span class="special">,</span> <span class="number">8</span><span class="special">)</span> <span class="special">==</span> <span class="number">0x00FF00FFu</span><span class="special">));</span>
+ <span class="identifier">BOOST_ASSERT</span><span class="special">((</span><span class="identifier">rotate_right</span><span class="special">(</span><span class="number">0xAABBCCDDu</span><span class="special">,</span> <span class="number">16</span><span class="special">)</span> <span class="special">==</span> <span class="number">0xCCDDAABBu</span><span class="special">));</span>
+ <span class="identifier">BOOST_ASSERT</span><span class="special">((</span><span class="identifier">rotate_right</span><span class="special">(</span><span class="number">0xFFFFFFFFu</span><span class="special">,</span> <span class="number">31</span><span class="special">)</span> <span class="special">==</span> <span class="number">0xFFFFFFFFu</span><span class="special">));</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+</div>
+</div>
 <div class="section" title="Round to Power of 2 functions">
 <div class="titlepage"><div><div><h3 class="title">
 <a name="boost_integer.bits_and_ints.round_to_power_of_2_functions"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.round_to_power_of_2_functions" title="Round to Power of 2 functions">Round
@@ -1805,6 +1980,34 @@
         </p>
 </div>
 </div>
+<div class="section" title="(Integral) Square Root">
+<div class="titlepage"><div><div><h3 class="title">
+<a name="boost_integer.bits_and_ints._integral__square_root"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints._integral__square_root" title="(Integral) Square Root">(Integral)
+ Square Root</a>
+</h3></div></div></div>
+<div class="toc"><dl><dt><span class="section">Synopsis</span></dt></dl></div>
+<p>
+ The header file <boost/integer/isqrt.hpp>
+ defines <code class="computeroutput"><span class="identifier">isqrt</span></code> functions wich
+ computes the integral part of square root of integral values.
+ </p>
+<div class="section" title="Synopsis">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="boost_integer.bits_and_ints._integral__square_root.synopsis"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints._integral__square_root.synopsis" title="Synopsis">Synopsis</a>
+</h4></div></div></div>
+<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">isqrt</span><span class="special">(</span><span class="identifier">uint8_t</span> <span class="identifier">value</span><span class="special">);</span>
+<span class="keyword">int</span> <span class="identifier">isqrt</span><span class="special">(</span><span class="identifier">uint16_t</span> <span class="identifier">value</span><span class="special">);</span>
+<span class="keyword">int</span> <span class="identifier">isqrt</span><span class="special">(</span><span class="identifier">uint32_t</span> <span class="identifier">value</span><span class="special">);</span>
+</pre>
+<p>
+ int isqrt(uint8_t value); int isqrt(uint16_t value); int isqrt(uint32_t
+ value);
+ </p>
+</div>
+<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
+<span class="bold"><strong>Returns: </strong></span> The square root of <code class="computeroutput"><span class="identifier">value</span></code> rounded down.
+ </li></ul></div>
+</div>
 <div class="section" title="Swap without a temporary (in-place)">
 <div class="titlepage"><div><div><h3 class="title">
 <a name="boost_integer.bits_and_ints.swap_without_a_temporary__in_place__"></a><a class="link" href="bits_and_ints.html#boost_integer.bits_and_ints.swap_without_a_temporary__in_place__" title="Swap without a temporary (in-place)">Swap

Modified: sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/boost_integer/history.html
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/boost_integer/history.html (original)
+++ sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/boost_integer/history.html 2010-07-29 11:29:53 EDT (Thu, 29 Jul 2010)
@@ -26,7 +26,7 @@
 <a name="boost_integer.history"></a><a class="link" href="history.html" title="History"> History</a>
 </h2></div></div></div>
 <a name="boost_integer.history.1_42_0"></a><h5>
-<a name="id36203718"></a>
+<a name="id36205757"></a>
       <a class="link" href="history.html#boost_integer.history.1_42_0">1.42.0</a>
     </h5>
 <div class="itemizedlist"><ul class="itemizedlist" type="disc">
@@ -55,7 +55,7 @@
       </li>
 </ul></div>
 <a name="boost_integer.history.1_32_0"></a><h5>
-<a name="id36203839"></a>
+<a name="id36205877"></a>
       <a class="link" href="history.html#boost_integer.history.1_32_0">1.32.0</a>
     </h5>
 <div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">

Modified: sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/index.html
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/index.html (original)
+++ sandbox/SOC/2010/bits_and_ints/libs/integer/doc/html/index.html 2010-07-29 11:29:53 EDT (Thu, 29 Jul 2010)
@@ -255,7 +255,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: July 29, 2010 at 13:53:45 GMT</small></p></td>
+<td align="left"><p><small>Last revised: July 29, 2010 at 15:27:59 GMT</small></p></td>
 <td align="right"><div class="copyright-footer"></div></td>
 </tr></table>
 <hr>

Added: sandbox/SOC/2010/bits_and_ints/libs/integer/example/rotate_example.cpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/bits_and_ints/libs/integer/example/rotate_example.cpp 2010-07-29 11:29:53 EDT (Thu, 29 Jul 2010)
@@ -0,0 +1,20 @@
+#include <boost/assert.hpp>
+#include <boost/integer/rotate.hpp>
+
+int main()
+{
+ using boost::rotate_left;
+ using boost::rotate_right;
+
+ BOOST_ASSERT((rotate_left(0xABCDEF12u, 24) == 0x12ABCDEFu));
+ BOOST_ASSERT((rotate_left(0x12345678u, 4) == 0x23456781u));
+ BOOST_ASSERT((rotate_left(0x0FF00000u, 6) == 0xFC000003u));
+ BOOST_ASSERT((rotate_left(0x00000000u, 31) == 0x00000000u));
+ BOOST_ASSERT((rotate_left(0xF0F0F0F0u, 4) == 0x0F0F0F0Fu));
+
+ BOOST_ASSERT((rotate_right(0xABCDEF12u, 8) == 0x12ABCDEFu));
+ BOOST_ASSERT((rotate_right(0x0000000Fu, 1) == 0x80000007u));
+ BOOST_ASSERT((rotate_right(0xFF00FF00u, 8) == 0x00FF00FFu));
+ BOOST_ASSERT((rotate_right(0xAABBCCDDu, 16) == 0xCCDDAABBu));
+ BOOST_ASSERT((rotate_right(0xFFFFFFFFu, 31) == 0xFFFFFFFFu));
+}
\ No newline at end of file

Modified: sandbox/SOC/2010/bits_and_ints/libs/integer/test/Jamfile.v2
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/libs/integer/test/Jamfile.v2 (original)
+++ sandbox/SOC/2010/bits_and_ints/libs/integer/test/Jamfile.v2 2010-07-29 11:29:53 EDT (Thu, 29 Jul 2010)
@@ -32,7 +32,6 @@
                 [ run isqrt_test.cpp ]
                 [ run find_first_one_string_test.cpp ]
                 [ run rotate_test.cpp ]
- [ run ilog2_policy_test.cpp ]
                 [ compile cstdint_include_test.cpp ]
                 [ compile integer_traits_include_test.cpp ]
                 [ compile integer_include_test.cpp ]


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