|
From: Per W. <pw...@ia...> - 2004-11-09 10:16:30
|
If you test the code, you will get values between 0 and 99, i.e. a lack of samples with value 100. using the time() of the application start as seed is very dangerous, which Netscape knows about... /Per W On Tue, 9 Nov 2004, Aitor Moreno wrote: > //Initialize.... > srand( (unsigned)time( NULL ) ); > > //Get a random value between 0 and 1 > unitvalue= (real)rand()/RAND_MAX; > > //Now yourvalue will be between 0 and 100 > yourvalue = 100*unitvalue; > > -- > Aitor Moreno > ait...@gm... > > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Sybase ASE Linux Express Edition - download now for FREE > LinuxWorld Reader's Choice Award Winner for best database on Linux. > http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |