diff --git a/include/boost/core/bit.hpp b/include/boost/core/bit.hpp index 7520abf..dfc2ab2 100644 --- a/include/boost/core/bit.hpp +++ b/include/boost/core/bit.hpp @@ -703,7 +703,7 @@ BOOST_CXX14_CONSTEXPR inline boost::uint32_t bit_ceil_impl( boost::uint32_t x ) { if( x == 0 ) { - return 0; + return 1; } --x; @@ -723,7 +723,7 @@ BOOST_CXX14_CONSTEXPR inline boost::uint64_t bit_ceil_impl( boost::uint64_t x ) { if( x == 0 ) { - return 0; + return 1; } --x; diff --git a/test/bit_ceil_test.cpp b/test/bit_ceil_test.cpp index fbb81d4..1b6af0d 100644 --- a/test/bit_ceil_test.cpp +++ b/test/bit_ceil_test.cpp @@ -21,7 +21,7 @@ template void test_bit_ceil( T x ) if( x == 0 ) { - BOOST_TEST_EQ( y, 0 ); + BOOST_TEST_EQ( y, 1 ); } else {