Post

A faster way to compute signed 64-bit floor division by constants

Ben Joffe describes a range-splitting technique for full-range signed floor division by compile-time constants, with benchmark comparisons against established multiply-and-shift approaches.

The author reports better throughput on many tested divisors, especially on ARM, but some x86 cases are slower and latency is often worse. In the HN discussion, readers raised throughput-versus-latency and precomputed-divisor trade-offs; the author clarified that the claimed novelty is the handling of negative inputs, not multiplication by reciprocal itself.