Xref: utzoo comp.sources.d:4525 comp.sources.games.bugs:1360 Path: 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 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