| ??? 12/25/03 22:11 Read: times |
#61391 - RE: Random number from 1 to 8 Responding to: ???'s previous message |
Oleg Sergeev wrote:
------------------------------- newRand = 1 + rand()%8;or newRand = 1 + rand()&7; I think 1 + rand() & 7 is wrong because this way all the random numbers above 7 are same as 7, ie I get 7 for newRand most of the time if you see what I mean. I need good distribution of newRand. 1 + rand()%8 I have to think about, thanks. Your idea of hardware random number generator is great, but since this project is for promotion and I'm not getting paid I have to do minimum effort, thats why my requirement is just to use rand function and no extra hardware. Mahmood |



