|
From: Aitor M. <ait...@gm...> - 2004-11-09 11:22:26
|
> If you test the code, you will get values between 0 and 99, i.e. a lack of > samples with value 100. In fact, like I use real numbers, the achieved numbers are between 0 and 99.9999999999... analytically.. the number is in the range [0..100) It can be 0 but no 100. In this situation, an int truncation must be performed ... > > using the time() of the application start as seed is very dangerous, which > Netscape knows about... I allways use this instruction: srand( (unsigned)time( NULL ) *rand()/RAND_MAX ); With this, a random number is used to seed the next random number... it is more reliable. Bye! -- Aitor Moreno ait...@gm... |