🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.games.emp
Article #50

rand problems

#50
From: utzoodecvaxharpoeaglemhtsaihnssi...
Date: Tue, 11 May 1982 16:58
15 lines
923 bytes
Looking at the C source, rand() returns an shift right of the iterated
random variable so its low order digits should be fine. Try digging up the
source on your system, its one line of code.

The only bias to taking rand() mod a value is that the values
0 through 0x7fff mod modvalue
are slightly more likely to occur than the values
(0x7fff mod modvalue) plus one through modvalue minus one.
In the case of an even divisor of 0x10000 ( this includes 8 ) there
should be no bias at all.

rand() gets blamed for all kinds of things, I think you should check this
out further.

				Lew Mammel, Jr. - BTL Indian Hill
Technical Details
Message-ID: <bnews.ihuxv.121>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
From: utzoo!decvax!harpo!eagle!mhtsa!ihnss!ihuxv!lew
Newsgroups: net.games.emp
Title: rand problems
Article-I.D.: ihuxv.121
Posted: Tue May 11 16:58:21 1982
Received: Wed May 12 03:30:35 1982
Subject: rand problems
Date: Tue, 11 May 1982 16:58:21 +0000
Message-ID: <bnews.ihuxv.121>