I am writing a Monte Carlo simulation, and I will need a lot of random bits to generate integers evenly distributed over {1,2, ..., N}, where N <40. The problem with using the C function randis that I would have spent a lot of beautiful bits using standard technique rand % N. What is the best way to generate integers?
I do not need cryptographically secure random numbers, but I do not want them to distort my results. Also, I am not considering downloading a batch of bits from random.org for a solution.
source
share