Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

(d4vis)Re:Re: Genuine Quantum Randomness

by d4vis (Chaplain)
on Jun 01, 2001 at 23:36 UTC ( [id://85039]=note: print w/replies, xml ) Need Help??


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

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

  • Comment on (d4vis)Re:Re: Genuine Quantum Randomness

Replies are listed 'Best First'.
Re: (d4vis)Re:Re: Genuine Quantum Randomness
by John M. Dlugosz (Monsignor) on Jun 02, 2001 at 00:22 UTC
    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")
        Sorry, what I meant is that my build doesn't include an improved random number generator.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://85039]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-04-25 20:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found