Skip to content

Fix constexpr round implementation for values in the range -1.0 to -0.5 and 0.5 to 1.0#1370

Merged
mborland merged 1 commit intoboostorg:developfrom
PowellNGL:develop
Feb 24, 2026
Merged

Fix constexpr round implementation for values in the range -1.0 to -0.5 and 0.5 to 1.0#1370
mborland merged 1 commit intoboostorg:developfrom
PowellNGL:develop

Conversation

@PowellNGL
Copy link
Contributor

In the constexpr implementations of the ccmath round functions, values between +-0.5 and +-1.0 are incorrectly rounded to zero. The fix is just to use the correct comparison operators in round_impl. I've also added some compile-time tests for the affected values

Copy link
Member

@mborland mborland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you! I kicked off the CI and will merge once it's green.

@mborland
Copy link
Member

CI failure unrelated. Merging.

@mborland mborland merged commit e6fb7d3 into boostorg:develop Feb 24, 2026
62 of 63 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