Newsgroups: comp.lang.c Path: utzoo!henry From: henry@zoo.toronto.edu (Henry Spencer) Subject: Re: random() error in Turbo C++ Message-ID: <1990Sep9.224536.17707@zoo.toronto.edu> Organization: U of Toronto Zoology References: <118662@linus.mitre.org> <17607@haddock.ima.isc.com> <1990Sep8.201520.15916@diku.dk> Date: Sun, 9 Sep 90 22:45:36 GMT In article daveg@near.cs.caltech.edu (Dave Gillespie) writes: >Sometimes rand() will tweak its results to be less blatantly bad >in the low bits, but every one I've seen was ultimately linear >congruential. The original Unix rand() did a 32-bit calculation internally and returned the HIGH-order 16 bits. Unfortunately, certain idiots porting the system to 32-bit machines wanted a 32-bit rand() and didn't bother understanding why it was done the way it was... -- TCP/IP: handling tomorrow's loads today| Henry Spencer at U of Toronto Zoology OSI: handling yesterday's loads someday| henry@zoo.toronto.edu utzoo!henry