Random Numbers ...

mcdonald at uxe.cso.uiuc.edu mcdonald at uxe.cso.uiuc.edu
Sat Feb 27 00:07:00 AEST 1988


Has anyone out there considered how to write a random number generator in
which the output is truly random? In my tests it seems that the low-order
bits have a very short repetition period. I've considered using two 
ordinary generators giving 32-bit periods and patching together the high
order words. Is this better?
    When I really needed a REAL random number, what I actually did was
to read the output of a analog-to-digital converter connected to a noise
source and XOR that with my ordinary generator. This only works if your
computer has an adc, unfortunately.

Doug McDonald



More information about the Comp.lang.c mailing list