Random number generator (included): Difference between revisions

(+Icon+Unicon)
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. ThisIcon LCRNGuses repeatsan withinitial aseed cycle lengthvalue of 10737418240 and Unicon randomizes the initial seed.
 
Icon uses an initial seed value of 0 and Unicon randomizes the initial seed.
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.
 
TheAdditionally, 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}}==
Anonymous user