Author: Antonio Senatore

Date: 13:45:29 07/22/04

Hi friends: I need to generate a random number between 0 and 100000. I'm using the following formula: srand((unsigned)(double)time(NULL)); random_number = (unsigned int) ((double) rand() / (double) RAND_MAX * 100000); However, the numbers that I obtain don't seem to be very aleatory that say; please, could someone tell me what am I doing bad? Thanks in advance Antonio

- Re: A question about random numbers
**Sean Empey***17:11:00 07/26/04* - Re: A question about random numbers
**Álvaro Begué***21:15:58 07/22/04* - Re: A question about random numbers
**Steven Edwards***13:51:03 07/22/04*- Re: A question about random numbers
**Scott Gasch***16:38:22 07/22/04*- Re: A question about random numbers
**Mike Byrne***17:43:51 07/22/04*

- Re: A question about random numbers

- Re: A question about random numbers

This page took 0.05 seconds to execute

Last modified: Thu, 07 Jul 11 08:48:38 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.