On this page:
initial-seed
next-seed
rand

2.7 "rand"

(include-book "rand" :dir :teachpacks)

This teachpack provides functional pseudorandom number generation.

procedure

(initial-seed)  posp

Produces a starting point for the pseudorandom number generator.

procedure

(next-seed seed)  posp

  seed : posp
Updates the pseudorandom seed. Call after each use of rand to avoid reusing a seed value.

procedure

(rand max seed)  natp

  max : posp
  seed : posp
Produces a number between 0 and (1- max), dependent on seed.