I want to collect the \"best\" way to generate random numbers on all four types of intervals in one place. I\'m sick of Googling this. Search results turn up a lot of crap.
First, generate random numbers on [a,b]. To generate random numbers on [a,b), just generate a random number on [a,b], check if it equals b, and if so try again. Similarly for all the other open interval variants.