The author addresses that: “You can correct the bias with a rejection, see my post on [fast shuffle functions](https://lemire.me/blog/2016/06/30/fast-random-shuffling/).”
threshold = -bound % bound
I don't understand how that isn't always zero. What am I missing?So it's doing (2^n - bound) % bound = 2^n % bound.