🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sources.d
Article #5165

Re: travestyyyyyyyy

#5165
From: brnstnd
Date: Sat, 06 Jan 1990 20:52
12 lines
1094 bytes
In article <2597@cunixc.cc.columbia.edu> shenkin@cunixc.cc.columbia.edu (Peter S. Shenkin) writes:
> Careful, though;  with rand() and srand(), only the 16 high-order bits
> have any semblence of randomness.  For example, on a 32 bit machine,
> rand() returns strictly alternating even and odd numbers!  (At least this
> was true on a VAX....)

It's generally safe to use rand() modulo various small numbers, even for
linear congruential sequences; unless those small numbers are all powers
of two and you're very unlucky, the small period of rand()'s low-order
bits won't affect anything.

---Dan
Technical Details
Message-ID: <2434@stealth.acf.nyu.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uwm.edu!rpi!ccnysci!phri!cmcl2!stealth.acf.nyu.edu!brnstnd
References: <815@stealth.acf.nyu.edu> <2597@cunixc.cc.columbia.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uwm.edu!rpi!ccnysci!phri!cmcl2!stealth.acf.nyu.edu!brnstnd
From: brnstnd@stealth.acf.nyu.edu
Newsgroups: comp.sources.d,comp.sources.games.bugs
Subject: Re: travestyyyyyyyy
Message-ID: <2434@stealth.acf.nyu.edu>
Date: 6 Jan 90 20:52:38 GMT
References: <815@stealth.acf.nyu.edu> <2597@cunixc.cc.columbia.edu>
Reply-To: brnstnd@stealth.acf.nyu.edu (Dan Bernstein)
Distribution: usa
Organization: IR
Lines: 12