How do I get random #s?

Peter Desnoyers desnoyer at Apple.COM
Tue Feb 14 05:31:58 AEST 1989


In article <514 at larry.UUCP> jwp at 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



More information about the Comp.lang.c mailing list