A faster way to compute signed 64-bit floor division by constants
- See also, other optimisation articles:Faster day-of-week functionsFaster time-of-day functionsThe missing chapter of Hacker's Delight27 October 2026What is signed integer floor division?
- Signed integer floor division is where you do a/b and get a result that rounds towards −∞,whereas standard (“truncated”) signed division rounds towards 0.
- As stated in Hacker's Delight: “[I suspect that] floor division more often gives the result you want”.
Unverified
- See also, other optimisation articles:Faster day-of-week functionsFaster time-of-day functionsThe missing chapter of Hacker's Delight27 October 2026What is signed integer floor division?
- Signed integer floor division is where you do a/b and get a result that rounds towards −∞,whereas standard (“truncated”) signed division rounds towards 0.
- As stated in Hacker's Delight: “[I suspect that] floor division more often gives the result you want”.
Sources: Benjoffe