in reply to Re: max random
in thread max random

You have to be careful with this. If you require random integers in a range greater than the number of random bits provided by your Perl installation, and get them using the usual multiply and int idiom, you won't get the results you want.

Eg. using the 15-bit rand() available from AS Perl to produce integers in the range 0 .. 100,000:

$x{ int( rand 100000 ) }++ for 1 .. 1000000;; print "$_ => $x{ $_ }" for sort{ $a <=> $b } keys %x;; 0 => 45 3 => 30 6 => 31 9 => 32 12 => 30 15 => 27 18 => 24 21 => 20 24 => 22 27 => 23 30 => 36 ...

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.