Skip to content

🐛 Fix bit_ceil() to return 1 for input 0 as per specification#199

Merged
pdimov merged 1 commit intoboostorg:developfrom
Pega5us:fix-issue#197-bitceil
Jun 6, 2025
Merged

🐛 Fix bit_ceil() to return 1 for input 0 as per specification#199
pdimov merged 1 commit intoboostorg:developfrom
Pega5us:fix-issue#197-bitceil

Conversation

@Pega5us
Copy link

@Pega5us Pega5us commented Jun 6, 2025

🐛 #197 Fix bit_ceil() to return 1 for input 0 as per specification

This PR fixes a bug in boost::core::bit_ceil() where the function returned 0 for an input of 0. According to the specification, it should return 1.

🔧 Changes

  • Corrected the implementation of bit_ceil() to return 1 when called with 0.
  • Added test coverage to validate the corrected behaviour.

✅ Impact

Aligns the function with the expected and documented behaviour. This fix prevents potential logical errors in code relying on bit_ceil(0) returning 1.

@pdimov pdimov merged commit 11d3673 into boostorg:develop Jun 6, 2025
70 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants