www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/06/05:40:06

Date: Thu, 6 Nov 1997 12:38:57 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: John Payne <jgp100 AT york DOT ac DOT uk>
cc: djgpp AT delorie DOT com
Subject: Re: rand() or random()
In-Reply-To: <Pine.SGI.3.95L.971106001932.6835A-100000@tower.york.ac.uk>
Message-ID: <Pine.SUN.3.91.971106123838.4123T-100000@is>
MIME-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019