Hi, By the looks of it, it looks like a Variable FORTRAN wants, though not necessarily needed for that routine and I vaguely recall how fussy those early languages like FORTRAN and COBOL were where when it comes to where they were merely spaced out. :D
I went to my copy of CALGO Volume II and here's both Pike and Hill's Algorithm 266 and Hansson's modification. There's also a certification of the algorithm by one Walter Sullins of Indiana State U, Terre Haute, but it's just a table of frequencies.
Here's Pike and Hill in all of its glorious ALGOL-60:
Code:
real procedure random(a, b, y);
real a,b; integer y;
comment Generates a random number in the interval (a,b);
begin
y :=3125 × y; y : = y - (y ÷67108864) × 67108864;
random := y/67108864.0 × (b - a) + a
end random
And here's Hansson's modification:
Code:
real procedure random(a, b, y);
real a,b; integer y;
begin
y :=125 × y; y : = y - (y ÷ 2796203) × 2796203;
random := y / 2796203 × (b - a) + a
end random
Hansson adds that any starting value for
y between 1 and 2796202 will serve as a seed.
ACM CALGO is a fascinating history in mathematics of computing. FWIW, Algorithm 1 is from 1960 and concerns quadrature integration.
I can follow the Algol examples a bit better, though I'm still stumped.
The problem I'm having must be something to do with the value of the "y" variable. If I'd assume that the "y" value was all the same then "y : = y - (y ÷ 2796203) × 2796203;" appears to cancel itself.
Though with "y :=125 × y;" does that mean the 2nd "y" is the same as the first "y".
Be good if there is some Algol-60 online, I found one for "Algol-68" though I've been reading about how notoriously complicated that is, so I don't really want to try that one and my Computer hasn't got Algol-60.