www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/11/21/10:13:14

Date: Thu, 21 Nov 1996 17:00:43 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: "Alexander V. Lukyanov" <lav AT video DOT yars DOT free DOT net>
Cc: djgpp AT delorie DOT com, fighteer AT cs DOT com, mad AT grupo DOT bfe DOT pt,
DJ Delorie <dj AT delorie DOT com>
Subject: Re: Problems with djgpp 2.01
In-Reply-To: <199611211143.OAA06514@video.yars.free.net>
Message-Id: <Pine.SUN.3.91.961121165550.24365B-100000@is>
Mime-Version: 1.0

On Thu, 21 Nov 1996, Alexander V. Lukyanov wrote:

> I don't know if it is declared in a standard, but I think rand()
> should always return the same sequence if srand is not used.
> Of course, I can do srand(0), but usually I don't have to.

ANSI C says that `rand' will always generate the same sequence if `srand' 
is not called before the first call to `rand'.  It also specifies that 
the above default sequence should be the same as if `srand' was called 
with a seed value of 1.  This means that the DJGPP implementation does 
not conform to this last requirement, since it generates a sequence as if 
`srand' was called with a seed of 0.

- Raw text -


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