|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: B T
Length: 934 (0x3a6)
Types: TextFile
Names: »B«
└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
└─⟦5cb1d1d7f⟧ »DATA«
└─⟦3b1ee7bd8⟧
└─⟦this⟧
-- THIS TEST RETURNS A A RANDOM INTEGER RESULT SUCH THAT (LOWER <= RESU
with Instrument;
use Instrument;
procedure Randa2 is
Cycle : constant Integer := 10000;
subtype Seed is Integer;
Prev : Seed := 3657;
subtype Random is Integer;
subtype Bound is Random;
L : Bound := 0;
U : Bound := 1000;
P : Seed := Prev;
R : Random;
procedure Rand (Lower : in Bound := 0; --LOWER BOUND
Upper : in Bound := 10; --UPPER BOUND
Prev : in out Seed; --VALUE USED TO COMPUTE NEXT ONE
Result : out Random) is
A : Integer := 3;
M : Integer := 2#1111111111011#;
begin
Prev := (A * Prev) mod M;
Result := (Prev mod (Upper - Lower + 1)) + Lower;
end Rand;
begin
Start ("RANDA2", " RANDOM NUMBER GENERATOR");
for I in 1 .. Cycle loop
Rand (L, U, P, R);
end loop;
Stop;
end Randa2;