Date: Thu, 29 Jul 1999 19:05:58 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Simon De Deyne cc: djgpp AT delorie DOT com Subject: Re: how about "more" random ? In-Reply-To: <7np18t$nj5$1@trex.antw.online.be> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Thu, 29 Jul 1999, Simon De Deyne wrote: > Thanks for the answer! I did consider this way, but then, > i also noticed that the seeding with the time function (srand) isn't > as random as when i used the other random function. Seed has nothing to do with randomness. > > So to produce a random number between 0 and 99 > > x = rand() % 100; The low bits of the random numbers are known to be not very random. If you want more random results, try this (untested!): x = ((double) rand ()) * 100 / RAND_MAX;