Date: Thu, 6 Nov 1997 12:38:57 +0200 (IST) From: Eli Zaretskii To: John Payne cc: djgpp AT delorie DOT com Subject: Re: rand() or random() In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Thu, 6 Nov 1997, John Payne wrote: > Just out of interest, can anybody find to hand the algorithm that GCC uses > for random(). I'm doing some work on Genetic Algorithms where a fairly > decent aproximation of randomness is quite important and it would be nice > to know that's GCC's random() is decent. You must be kidding. DJGPP comes with full sources to its C library. Just download v2/djlsr201.zip, and look into the sources of `random' (src/libc/compat/stdlib/random.c). Btw, you should distinguish between the compiler and the library. GCC knows nothing about the DJGPP C library. To GCC, `random' is just another function, it doesn't even know whether it is in the library or written by you as part of your program.