Random number generator (device): Difference between revisions
Random number generator (device) (view source)
Revision as of 05:28, 29 September 2012
, 11 years agono edit summary
(Add NetRexx implementation) |
No edit summary |
||
Line 387:
<lang tcl>% puts [systemRandomInteger]
636131349</lang>
=={{header|XPL0}}==
The random number generator is seeded with the 32-bit system timer each
time a program starts. From then on, a linear congruential algorithm is
used (that passes the Diehard test suite). Since the Ran intrinsic routine
returns a signed positive integer (modulo the argument), the value is
limited to 31 bits.
<lang XPL0>code Ran=1;
int R;
R:= Ran($7FFF_FFFF)</lang>
{{omit from|GUISS}}
|