Daniel Lemire personal blog
A fast alternative to the modulo reduction (2016)
Suppose you want to pick an integer at random in a set of N elements. Your computer has functions to generate random 32-bit integers, how do you transform such numbers into indexes no larger than N? Suppose you have a hash table with a capacity N. Again, you need to transform your hash values (typically 32-bit ……
- Points
- 114
- HN comments
- 68
- Submissions
- 2
- Cited by
- 13 commenters
Math & AlgorithmsSystems & Performance2019
On Hacker News
| Submitted | Title on HN | Points | Comments |
|---|---|---|---|
| Oct 6, 2019 | A fast alternative to the modulo reduction (2016) by bra-ket | 114 | 35 |
| Aug 16, 2021 | A fast alternative to the modulo reduction (2016) by karmakaze | 63 | 33 |
Cited in comments
Linked from 13 Hacker News comments by 13 different people, from Feb 2017 to Feb 2026.
Most recent: