Anonymous user
Random number generator (included): Difference between revisions
Random number generator (included) (view source)
Revision as of 16:03, 17 September 2010
, 13 years ago→{{header|Icon}} and {{header|Unicon}}: quirks
(+Icon+Unicon) |
(→{{header|Icon}} and {{header|Unicon}}: quirks) |
||
Line 68:
=={{header|Icon}} and {{header|Unicon}} ==
Icon and Unicon both use the same linear congruential random number generator x := (x * 1103515245 + 453816694) mod 2^31.
This LCRNG has a number of well documented quirks (see [http://www.cs.arizona.edu/icon/analyst/ia.htm The Icon Analyst issues #26, 28, 38]) relating to the choices of an even additive and a power of two modulus. This LCRNG produces two independent sequences of length 2^30 one of even numbers the other odd.
The {{libheader|Icon Programming Library}} [http://www.cs.arizona.edu/icon/library/src/procs/random.icn random] provides additional related procedures including a parametrized LCRNG that defaults to the built-in values.▼
▲
=={{header|J}}==
|