www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/10/31/01:33:36

From: Nate Eldredge <neldredge AT hmc DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: rand and random
Date: Sat, 30 Oct 1999 23:26:06 -0700
Organization: Harvey Mudd College
Lines: 20
Message-ID: <381BE0FE.88C50410@hmc.edu>
References: <s1n73iu5iqi71 AT corp DOT supernews DOT com> <p6obOB+BRMP7QeUGn1Z+l2JBPBVt AT 4ax DOT com>
NNTP-Posting-Host: mercury.st.hmc.edu
Mime-Version: 1.0
X-Trace: nntp1.interworld.net 941351198 74930 134.173.45.219 (31 Oct 1999 06:26:38 GMT)
X-Complaints-To: usenet AT nntp1 DOT interworld DOT net
NNTP-Posting-Date: 31 Oct 1999 06:26:38 GMT
X-Mailer: Mozilla 4.61 [en] (X11; U; Linux 2.2.14pre3 i586)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Damian Yerrick wrote:
> 
> On Sat, 30 Oct 1999 18:30:03 -0700,
> "Al Morgan" <muaddib AT proaxis DOT com> wrote:
> 
> > How does one use the rand(), and random() functions?
> 
> Read the libc docs.
> 
> But I know you're busy:
> 
> rand() will give a number between 0 and 32,767.
                                          ^^^^^^
2147483647 (i.e. largest possible int) is the correct number for DJGPP's
rand().  For portability, use the macro RAND_MAX.

-- 

Nate Eldredge
neldredge AT hmc DOT edu

- Raw text -


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