in reply to Re: Genuine Quantum Randomness
in thread Genuine Quantum Randomness

I looked at lavaland just the other day, and it seems to be defunct. No updates in a couple years, and plans for stuff that may get done during 2000. Can't get any freshly generated random data from them.

If I were to build something, I think a radio tuned to no station, patched to the mic input on a sound card would be a good and cheap chaos sampler.

How does the random number generator in Perl's rand work? It seems pretty good, and I remember years ago reading that they no longer use the C library's generator.

—John

Replies are listed 'Best First'.
(d4vis)Re:Re: Genuine Quantum Randomness
by d4vis (Chaplain) on Jun 01, 2001 at 23:36 UTC
    From the perldelta for v5.6.0:

    Better pseudo-random number generator
    In 5.005_0x and earlier, perl's rand() function used the C library rand(3) function. As of 5.005_52, Configure tests for drand48(), random(), and rand() (in that order) and picks the first one it finds.

    These changes should result in better random numbers from rand().

    ~monk d4vis
    #!/usr/bin/fnord

      Hmm, it looks like that doesn't apply to the ActiveState build. Looking through the source, it just calls rand(), which happens to be

      holdrand = holdrand * 214013L + 2531011L) >> 16) & 0x7fff)

      which I thought was brain-dead but seems to pass tests for randomness including chi-square. Owell.

        Well, in some ways it does apply. It is just that Win32 doesn't have a Bourne shell so the Configure step has to be done "by hand" by porters. The porters picked the first of drand48(), random(), and rand() that was available. For Win32, the answer is rand().

                - tye (but my friends call me "Tye")