Linear congruential generator: Difference between revisions

m
→‎{{header|REXX}}: added/changed whitespace and comments.
m (added whitespace and highlighting to make it easier to see which formula is which.)
m (→‎{{header|REXX}}: added/changed whitespace and comments.)
Line 2,413:
 
=={{header|REXX}}==
<lang rexx>/*REXX program isuses a congruential generator whichthat simulates the old BSD and MS random */
/*──────────── number generators. BSD= 0 ──► (2**31)-1 MS= 0 ──► (2**16)-1 */
numeric digits 20 /*useduse enough digitsdec. digs for the multiply.*/
 
do seed=0 to 1 /*perform for seed=0 and also seed=1.*/
bsd= seed; ms= seed /*assign SEED to two REXX variables.*/
say center('seed='seed, 79, '"'") /*display the seed in a title/separator*/
/* [↓] show 20 rand #'s for each seed.*/
do j=1 for 20 /*obtaingenerate theand right─mostdisplay 320 digitsrand of Jnumbers.*/
bsd = (1103515245 * bsd + 12345) // 2**31
ms = ( 214013 * ms + 2531011) // 2**31