You might remember how @mattgodbolt discussed integer division by a fixed integer in and ofc I already spent way more time than justified on these two lines of code, but here is the reminder godbolt.org/z/d9eMWYsEq with [[assume]]

With , there's another tweak godbolt.org/z/89nn91o74 how to tell the compiler "sar is fine": div_euclid

0

If you have a fediverse account, you can quote this note from your own instance. Search https://chaos.social/users/pseyfert/statuses/115887065312930333 on your instance and quote it. (Note that quoting is not supported in Mastodon.)