delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/22/14:00:48

From: Mirek Prywata <mpry AT fuw DOT edu DOT pl>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: random numbers?
Date: Thu, 22 Jan 1998 20:02:47 +0100
Organization: ift
Lines: 17
Message-ID: <34C797D7.4FE23B3F@fuw.edu.pl>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 980122183421 DOT 1427F-100000 AT is> <34C78C11 DOT 3D2898C6 AT fuw DOT edu DOT pl> <6a82ee$k6k$1 AT news DOT ox DOT ac DOT uk>
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

George Foot wrote:
> 
> : That's true, I was wrong. I simply meant
> : int random(int) and not int random (void)
> 
> ... but even so, random does not take an integer.  I don't have djgpp
> here to check, but the prototype should be `int random (void);'.

if you want to have random numbers, but not as big as RAND_MAX (or
MAX_RAND - I don't remember) then you can easily make random() that
returns numbers from <0,MY_RAND_MAX>. That's random(int) i meant.

IMHO there's no point in using different generator from rand(). If you
want to have better generator you must write it on your own, in order to
know, how it works.

						M.P.

- Raw text -


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