Mail Archives: djgpp/1997/11/06/05:40:06
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.
- Raw text -