Linear congruential generator: Difference between revisions
→corrected code
Line 1,938:
=={{header|Pascal}}==
<lang pascal>Program LinearCongruentialGenerator(output);
{$mode iso}
var
x1, x2: int64;
function bsdrand:
const
a = 1103515245;
Line 1,953 ⟶ 1,952:
bsdrand := x1;
end;
function msrand:
const
a = 214013;
Line 1,963 ⟶ 1,962:
msrand := x2 div 65536;
end;
var
i:
begin
writeln(' BSD MS');
Line 1,972 ⟶ 1,971:
for i := 1 to 10 do
writeln(bsdrand:12, msrand:12);
end.
</lang>
Output:
<pre> BSD MS
12345
1109335178
1293799192
=={{header|Perl}}==
|