Excellent points. I’ll add one more observation:
The call to time() is presumably there to add entropy (randomness). But time returns the number of seconds since the epoch; and for a run of 101 values, the script completes in less than a second, so time() returns at most two different values! This adds almost nothing to the randomness of the result.
I’m no mathematician, but I’d be surprised if the output of the algorithm being tried (when properly debugged) is any more “random” than Perl’s out-of-the-box equivalent:
print int(rand(1e4)), "\n" for 0 .. 100;
(Note that the first call to rand implicitly calls srand here.)
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re^2: random question
by Athanasius
in thread random question
by perlaintdead
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |