3 ms·
Another use of popcount: generating binomial random variates corresponding to n coin flips in early games. Rather than looping n times, flipping coins and count
by tmoertel 3y ago
Another use of popcount: generating binomial random variates corresponding to n coin flips in early games. Rather than looping n times, flipping coins and counting heads, you generated a new random number, masked off the bottom n bits, and hit ’em with popcount.