delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/22/09:45:22

From: Mirek Prywata <mpry AT fuw DOT edu DOT pl>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: random numbers?
Date: Thu, 22 Jan 1998 15:36:49 +0100
Organization: ift
Lines: 30
Message-ID: <34C75981.7A16524A@fuw.edu.pl>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 980121174156 DOT 28141E-100000 AT is> <34C623E7 DOT 4BBD AT utc DOT fr>
NNTP-Posting-Host: solth2.fuw.edu.pl
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Van Mo Dang wrote:
> 
> Eli Zaretskii wrote:
> 
>  > > 2 - Which file should be included to know their prototypes ?
> >
> > None.  Just declare the prototype yourself.
> 
> Thank you for your fast answer and the information.
> Isn't it kind of unusual that the prototypes of these functions
> are not declared in any constant header file?

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. They
are popular IMHO because of Borland C (maybe some other compiler have
them as well). If you want to know sth more about random number
generators, just read the chapter from Numerical Recipes (it's available
on the net as postscript). There are examples or better and worse random
number generator. After reading it, you can take a look at the source of
rand.c in DJGPP. Or you can easily compile your own random number
generator.

One more thing random() is niether better nor worse than rand() /random
as a macro using rand/

You will never get random() numbers from computer, you can have only
pseudo-random numbers.


							Mirek

- Raw text -


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