class STD_RAND

Features exported to ANY

Press' standard generator, which uses the minimal standard and then uses shuffling to break up short order corelations.

Direct parents

conformant parents

MIN_STAND

non-conformant parents

MIN_STAND

Summary

creation features

exported features

No modifications:

Details

with_seed (seed_value: INTEGER)

Create the generator with an explicit seed_value.

require

  • valid_seed: seed_value > 0 and seed_value < im

make

Create the generator with an automatic hazardous setting of the seed_value. Because automatic setting may be done using internal address of Current for example, it may produces platform dependent behavior or compilation-mode dependant behavior. Also consider with_seed to chose the most appropriate.

with_seed (seed_value: INTEGER)

Create the generator with an explicit seed_value.

require

  • valid_seed: seed_value > 0 and seed_value < im

next

Compute next random number in sequence.

last_integer (n: INTEGER): INTEGER

Look the last computed number. Range 1 to n.

require

  • n >= 1

ensure

  • 1 <= Result and Result <= n

last_real: REAL

Look at the last computed number. Range 0 to 1

ensure

  • Result > 0 and Result <= 1

im: INTEGER
make

Create the generator with an automatic hazardous setting of the seed_value. Because automatic setting may be done using internal address of Current for example, it may produces platform dependent behavior or compilation-mode dependant behavior. Also consider with_seed to chose the most appropriate.

last_double: REAL
This feature is obsolete: Use `last_real' instead (nov 4th 2004).

Class invariant