Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!apple!desnoyer From: desnoyer@Apple.COM (Peter Desnoyers) Newsgroups: comp.lang.c Subject: Re: How do I get random #s? Message-ID: <25745@apple.Apple.COM> Date: 13 Feb 89 19:31:58 GMT References: <19415@dhw68k.cts.com> <225800121@uxe.cso.uiuc.edu> <514@larry.UUCP> Organization: Apple Computer Inc, Cupertino, CA Lines: 23 In article <514@larry.UUCP> jwp@larry.UUCP (Jeffrey W Percival) writes: >>I think it is. If you really need extremely good random deviates >>then you have a lot of research and hard work to do. > >Why is this true? No one tells me that if I want a *really* good C >compiler, I have a lot of work to do, or if I want a *really* good >operating system, I have a lot of work to do. > If you program in SIMSCRIPT or SIMULA or any other simulation language (except GPSS) you will get a fine random number generator at your disposal. C was evidently designed by people who didn't need random numbers - the standardized rand() doesn't allow a seed to be specified, making it useless when you need independent streams of random numbers. BTW, you don't need to do a lot of work - just look up a few references. Any reasonably theoretical book on simulation should go into generation of random deviates, spectral measures of randomness, etc. You can usually skip most of that and copy an algorithm from Knuth, anyway. Peter Desnoyers