Post #1008178
2026-01-13 09:24 UTC
You might remember how @mattgodbolt discussed integer division by a fixed integer in #aoco and ofc I already spent way more time than justified on these two lines of code, but here is the #cpp reminder https://godbolt.org/z/d9eMWYsEq with [[assume]]
With #rustlang , there's another tweak https://godbolt.org/z/89nn91o74 how to tell the compiler "sar is fine": div_euclid
Replies (1)
-
@PingYourOwnDevice@cyberplace.social 2026-01-14 17:00
@pseyfert @mattgodbolt Ok, but at that point I just don't understand the refusal to just write num >> 5