Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63995 - in sandbox/SOC/2010/bits_and_ints: boost/integer libs/integer/test
From: muriloufg_at_[hidden]
Date: 2010-07-13 15:59:50


Author: murilov
Date: 2010-07-13 15:59:49 EDT (Tue, 13 Jul 2010)
New Revision: 63995
URL: http://svn.boost.org/trac/boost/changeset/63995

Log:
Added ilog2.hpp wich contains a function wich calculates the integer log2 of an value
Text files modified:
   sandbox/SOC/2010/bits_and_ints/boost/integer/count_leading_zeros.hpp | 4 ++--
   sandbox/SOC/2010/bits_and_ints/libs/integer/test/Jamfile.v2 | 1 +
   sandbox/SOC/2010/bits_and_ints/libs/integer/test/count_leading_zeros_test.cpp | 3 +--
   3 files changed, 4 insertions(+), 4 deletions(-)

Modified: sandbox/SOC/2010/bits_and_ints/boost/integer/count_leading_zeros.hpp
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/boost/integer/count_leading_zeros.hpp (original)
+++ sandbox/SOC/2010/bits_and_ints/boost/integer/count_leading_zeros.hpp 2010-07-13 15:59:49 EDT (Tue, 13 Jul 2010)
@@ -60,7 +60,7 @@
         value = value | (value >> 4);
         value = value | (value >> 8);
         value = value | (value >> 16);
-
+
         return pop_count(T(~value));
 }
 
@@ -73,7 +73,7 @@
         value = value | (value >> 4);
         value = value | (value >> 8);
         value = value | (value >> 16);
- value = value | (value >> 16);
+ value = value | (value >> 32);
         
         return pop_count(T(~value));
 }

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-13 15:59:49 EDT (Tue, 13 Jul 2010)
@@ -27,6 +27,7 @@
                 [ run safe_avg_test.cpp ]
                 [ run isign_test.cpp ]
                 [ run count_leading_zeros_test.cpp ]
+ [ run ilog2_test.cpp ]
                 [ compile cstdint_include_test.cpp ]
                 [ compile integer_traits_include_test.cpp ]
                 [ compile integer_include_test.cpp ]

Modified: sandbox/SOC/2010/bits_and_ints/libs/integer/test/count_leading_zeros_test.cpp
==============================================================================
--- sandbox/SOC/2010/bits_and_ints/libs/integer/test/count_leading_zeros_test.cpp (original)
+++ sandbox/SOC/2010/bits_and_ints/libs/integer/test/count_leading_zeros_test.cpp 2010-07-13 15:59:49 EDT (Tue, 13 Jul 2010)
@@ -7,7 +7,6 @@
 
 #include <boost/detail/lightweight_test.hpp>
 #include <boost/integer/count_leading_zeros.hpp>
-#include <boost/mpl/integral_c.hpp>
 #include <boost/cstdint.hpp>
 #include <iostream>
 
@@ -18,7 +17,7 @@
 int main(int, char* [])
 {
         using namespace boost;
- std::cout << "Doing tests on safe_avg functions." << std::endl;
+ std::cout << "Doing tests on count leading zeros function." << std::endl;
         
         CLZ_TEST(uint8_t(0xFF), 0);
         CLZ_TEST(uint8_t(0x7F), 1);


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