Article View: net.bugs
Article #413Re: Bug in rand() and srand()
From: Alexis Dimitriadis
Date: Sat, 09 Mar 1985 02:34
Date: Sat, 09 Mar 1985 02:34
10 lines
1136 bytes
1136 bytes
> A better way around the problem is to use the more > sophisticated random number generator random() all of its bits are supposed > to be random and its really not that much slower than rand(). A simple > #define rand random can fix your code. Our version of 4.2 random() ALWAYS returns an even number the first time it is called after being seeded. That effectively breaks small applications that call random only once. (Or those that seed it for every call). alexis
Technical Details
Message-ID:
<1067@reed.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!cbosgd!ihnp4!mhuxn!mhuxm!sftig!sftri!sfmag!eagle!ulysses!unc!mcnc!decvax!tektronix!reed!alexisReferences:
<320@cubsvax.UUCP> <433@lll-crg.ARPA>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site reed.UUCP Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!cbosgd!ihnp4!mhuxn!mhuxm!sftig!sftri!sfmag!eagle!ulysses!unc!mcnc!decvax!tektronix!reed!alexis From: alexis@reed.UUCP (Alexis Dimitriadis) Newsgroups: net.bugs,net.unix,net.lang.c,net.math Subject: Re: Bug in rand() and srand() Message-ID: <1067@reed.UUCP> Date: Fri, 8-Mar-85 21:34:03 EST Article-I.D.: reed.1067 Posted: Fri Mar 8 21:34:03 1985 Date-Received: Mon, 11-Mar-85 04:12:29 EST References: <320@cubsvax.UUCP> <433@lll-crg.ARPA> Organization: Reed College, Portland, Oregon Lines: 10