Random number generator (included): Difference between revisions

no edit summary
(Added Java)
No edit summary
Line 6:
=={{header|Java}}==
Java's <code>Random</code> class uses a [[wp:Linear congruential generator|Linear congruential formula]], as described in [http://java.sun.com/javase/6/docs/api/java/util/Random.html its documentation].
=={{header|PHP}}==
PHP has two random number generators: <code>[http://us3.php.net/manual/en/function.rand.php rand]</code>, which uses the underlying C library's <code>rand</code> function; and <code>[http://us3.php.net/manual/en/function.mt-rand.php mt_rand]</code>, which uses the [[wp:Mersenne twister|Mersenne twister]] algorithm.
=={{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|Ruby}}==
Ruby's <code>rand</code> function currently uses the [[wp:Mersenne twister|Mersenne twister]] algorithm, as described in [http://www.ruby-doc.org/core/classes/Kernel.html#M005974 its documentation].
 
=={{header|Tcl}}==
Anonymous user