From: mert0407 AT sable DOT ox DOT ac DOT uk (George Foot) Newsgroups: comp.os.msdos.djgpp Subject: Re: random numbers error in DJGPP Date: Mon, 03 Feb 1997 00:45:04 GMT Organization: Oxford University Lines: 16 Message-ID: <32f5347e.55459837@news.ox.ac.uk> References: <32F44A89 DOT 3142 AT ix DOT netcom DOT com> <01bc0d3a$8782ece0$5e0520ce AT d-moran> <32f4dc71 DOT 16473293 AT ursa DOT smsu DOT edu> <32f4edb6 DOT 6181778 AT news DOT cc DOT columbia DOT edu> NNTP-Posting-Host: mc31.merton.ox.ac.uk To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp On Sun, 02 Feb 1997 19:43:40 GMT, cpw10 AT columbia DOT edu (Chester Wong) wrote: >On Sun, 02 Feb 1997 18:29:52 GMT, aho450s AT nic DOT smsu DOT edu (Tony O'Bryan) >wrote: > >>rand() and RND do not work the same way. rand() returns a number from 0 to >>RAND_MAX according to the info file. > >For some reason, I was never able to find RAND_MAX documented anywhere. >Is RAND_MAX the same as INT_MAX, or should I not make this assumption? I wouldn't; I would just use random(), which returns a number between 0 and MAXINT, and use srandom(int) to seed the generator beforehand. George Foot