|
-
October 23rd, 2000, 01:42 PM
#1
Random Number Generation
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|