Date: Thu, 22 Jan 1998 18:38:13 +0200 (IST) From: Eli Zaretskii To: Mirek Prywata cc: djgpp AT delorie DOT com Subject: Re: random numbers? In-Reply-To: <34C75981.7A16524A@fuw.edu.pl> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Thu, 22 Jan 1998, Mirek Prywata wrote: > You do not understand or you pretend you don't understand. random() and > randomize(), etc are only MACROS, which does not belong to ANSI C. This is only correct for Borland. In DJGPP and many Unix compilers, `random' is a function, not a macro, and it uses an entirely different algorithm. Please make a point to double-check yourself before posting such definitive replies. > One more thing random() is niether better nor worse than rand() /random > as a macro using rand/ Wrong again. `random' uses a different algorithm that makes low-order bits much more random than what `rand' returns. For example, random()%3 will yield much more random 2-bit number than rand()%3.