Subtractive generator: Difference between revisions
Content added Content deleted
m (→{{header|Kotlin}}: Replaced tab with spaces) |
m (→{{header|REXX}}: changed order of an assignment.) |
||
Line 1,491: | Line 1,491: | ||
{{trans|PL/I}} |
{{trans|PL/I}} |
||
<lang rexx>/*REXX program uses a subtractive generator, and creates a sequence of random numbers. */ |
<lang rexx>/*REXX program uses a subtractive generator, and creates a sequence of random numbers. */ |
||
s.0=292929; s.1=1; billion= |
s.0=292929; s.1=1; billion=1e9 /* ◄────────┐ */ |
||
numeric digits 20; billion= |
numeric digits 20; billion=10**9 /*same as─►─┘ */ |
||
cI=55; do i=2 to cI-1 |
cI=55; do i=2 to cI-1 |
||
s.i=mod(s(i-2) - s(i-1), billion) |
s.i=mod(s(i-2) - s(i-1), billion) |