Random number generator (included): Difference between revisions

no edit summary
(New (draft) task and Python solution.)
 
No edit summary
Line 7:
=={{header|Python}}==
Python uses the [[wp:Mersenne twister|Mersenne twister]] algorithm accessed via the built-in [http://docs.python.org/library/random.html random module].
 
=={{header|Tcl}}==
Tcl uses a [[wp:Linear congruential generator|linear congruential generator]] in it's built-in <code>rand()</code> function. This is seeded by default from the system time, and kept per-interpreter so different security contexts and different threads can't affect each other's generators (avoiding key deployment issues with the rand function from [[C]]'s math library).
 
Citations (from Tcl source code):
* S.K. Park & K.W. Miller, “''Random number generators: good ones are hard to find'',” Comm ACM 31(10):1192-1201, Oct 1988
* W.H. Press & S.A. Teukolsky, “''Portable random number generators'',” Computers in Physics 6(5):522-524, Sep/Oct 1992.
Anonymous user