mirror of
https://github.com/boostorg/core.git
synced 2025-07-29 20:37:22 +02:00
Merge pull request #199 from Pega5us/fix-issue#197-bitceil
🐛 Fix bit_ceil() to return 1 for input 0 as per specification
This commit is contained in:
@ -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;
|
||||
|
@ -21,7 +21,7 @@ template<class T> void test_bit_ceil( T x )
|
||||
|
||||
if( x == 0 )
|
||||
{
|
||||
BOOST_TEST_EQ( y, 0 );
|
||||
BOOST_TEST_EQ( y, 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user