Is there a function in MFC to generate a random number that is LESS
THAN a user-defined upper limit?

When I used to program in Turbo C I had used such a function. But in
MFC, I see that there are only functions that generate random numbers
between a LOWER limit and the constant RAND_MAX (which I can't change
anyway). I cannot set the upper limit.

I am looking for a method other than comparing each generated random
number with the upper limit & discarding bigger numbers.
Thanx a lot.