From owner-freebsd-hackers Thu Oct 3 07:57:27 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id HAA01343 for hackers-outgoing; Thu, 3 Oct 1996 07:57:27 -0700 (PDT) Received: from sovcom.kiae.su (sovcom.kiae.su [193.125.152.1]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id HAA01337 for ; Thu, 3 Oct 1996 07:57:20 -0700 (PDT) Received: by sovcom.kiae.su id AA02666 (5.65.kiae-1 ); Thu, 3 Oct 1996 17:51:57 +0300 Received: by sovcom.KIAE.su (UUMAIL/2.0); Thu, 3 Oct 96 17:51:57 +0300 Received: (from ache@localhost) by nagual.ru (8.7.6/8.7.3) id SAA00772; Thu, 3 Oct 1996 18:51:30 +0400 (MSD) Message-Id: <199610031451.SAA00772@nagual.ru> Subject: Re: rand() and random() In-Reply-To: <199610031252.OAA26494@uriah.heep.sax.de> from "J Wunsch" at "Oct 3, 96 02:52:26 pm" To: joerg_wunsch@uriah.heep.sax.de Date: Thu, 3 Oct 1996 18:51:29 +0400 (MSD) Cc: freebsd-hackers@freebsd.org, jmacd@CS.Berkeley.EDU From: =?KOI8-R?Q?=E1=CE=C4=D2=C5=CA_=FE=C5=D2=CE=CF=D7?= (Andrey A. Chernov) Organization: self X-Class: Fast X-Mailer: ELM [version 2.4ME+ PL26 (25)] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > I vote for killing the old rand(). Too many things (in particular, > games) behave very stupid with it. random() isn't good enough too. However the problem is different with rand() case. The problem is that srandom() not accomodate startup value well, i.e. produce the same _few_ sequences for _many_ different startup values. I remember bug report related to this problem (with suggested random() replacement) somewhere in freebsd mailing lists long time ago. -- Andrey A. Chernov http://www.nagual.ru/~ache/