Module Interface RandomNumbers

SUMMARY: MODULE | CLASS | TYPE | PROC | VAR | CONST | DETAIL: TYPE | PROC | VAR | CONST

# RandomNumbers

For details on this algorithm take a look at Park S.K. and Miller K.W. (1988). "Random number generators, good ones are hard to find". Communications of the ACM, 31, 1192-1201.

Procedure Summary
GetSeed(VAR LONGINT) Returns the currently used seed value.
PutSeed(LONGINT) Set seed as the new seed value.
RND(LONGINT): LONGINT Calculates a new number.
Random(): REAL Calculates a number ``x`' with ``0.0 <= x < 1.0`'.

Constant Summary
modulo

Procedure Detail

### GetSeed

    PROCEDURE GetSeed(VAR seed: LONGINT)

> Returns the currently used seed value.

### PutSeed

    PROCEDURE PutSeed(seed: LONGINT)

> Set seed as the new seed value. Any values for seed are allowed, but values beyond the intervall ``[1..2^31-2]`' will be mapped into this range.

### RND

    PROCEDURE RND(range: LONGINT): LONGINT

> Calculates a new number. range has to be in the intervall ``[1..2^31-2]`'. Result is a number from ``0,1,..,range-1`'.

### Random

    PROCEDURE Random(): REAL

> Calculates a number ``x`' with ``0.0 <= x < 1.0`'.

Constant Detail

### modulo

    CONST modulo