I am really confused on this problem someone please assist me I am suppose to create a random number generator that passes in a high and low value and return a random number using a generator that is not biased. It makes use of the idea of cuttoff. I know there are better generators but I have to use this one Here is the code that I have.
long randint(long low, long high)
while((r=rng()) >= cutoff)
I don't understand what the p value does and from this how do you get the random number your looking for in the range low to high?