Re: 32-bit random numbers
- Posted by Derek Parnell <ddparnell at bigpond.com> Jul 05, 2004
- 573 views
Juergen Luethje wrote: [snip] > Derek, do you think using set_rand() is essential here? If you are after a pseudo-random generator then it would not be required, but if you want truer randomness, then it would be helpful. Each value returned by rand() is dependent on the previous value, the initial seed and how many previous values you have gotten so far. By inserting set_rand() with values not based on anything that rand() returns, you will get more unpredictablity about which value will be the next returned by rand(). Without this, you can 100% 'predict' the value because it is calulated. In general use, this is not a big issue, but in areas of gaming, encryption, and other high-volume random numbers, it is important. -- Derek Parnell Melbourne, Australia