The GNU Modula-2 front end to GCC

ulm-lib-gm2/std/RandomGenerator

DEFINITION MODULE RandomGenerator;

   (*    Anyone who considers arithmetical
	methods of producing random digits
	 is, of course, in a state of sin.
		 - John von Neumann (1951)
   *)


   PROCEDURE IntVal() : INTEGER;
      (* get random 32-bit value *)


   PROCEDURE RealVal() : REAL;
      (* get a uniformly distributed real value in [0..1) *)


   PROCEDURE Random(low, high: INTEGER) : INTEGER;
      (* get a uniformly distributed integer in [low..high] *)


   PROCEDURE Flip() : BOOLEAN;
      (* return TRUE or FALSE *)


   PROCEDURE Init(seed: INTEGER);

END RandomGenerator.