Programming · by Noah Miller · 2026-10-28
A faster algorithm for 64-bit signed floor division
Nice deep dive on computing floor division for signed 64-bit ints faster than the usual 'divide then fix up' approach. Most languages truncate toward zero, Python floors, and the fix-up branch costs more than you'd think in hot loops. Has anyone actually hit this as a bottleneck in real code?
20 sparks · 2 comments