www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/03/11:26:21

Date: Mon, 3 Feb 1997 18:08:31 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Chester Wong <cpw10 AT columbia DOT edu>
cc: djgpp AT delorie DOT com
Subject: Re: random numbers error in DJGPP
In-Reply-To: <32f4edb6.6181778@news.cc.columbia.edu>
Message-ID: <Pine.SUN.3.91.970203180536.27257C-100000@is>
MIME-Version: 1.0

On Sun, 2 Feb 1997, Chester Wong wrote:

> For some reason, I was never able to find RAND_MAX documented anywhere.

What documentation do you need?  libc.inf documents that `rand' returns a
random integer between 0 and RAND_MAX.  If you need to know its value,
RAND_MAX is defined on <stdlib.h>, but IMHO you gain nothing by knowing
exactly what value does it have. 

> Is RAND_MAX the same as INT_MAX, or should I not make this assumption?

No, you should not assume this in a portable program.

- Raw text -


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