You are looking at historical revision 34052 of this page. It may differ significantly from its current revision.

Module (chicken process-context)

This module provides a (weak) pseudo random number generator.

randomize

[procedure] (randomize [SEED])

Set random-number seed. If SEED (an exact integer) is not supplied, the current time is used. On startup (when Unit extras is initialized), the random number generator is initialized with the current time.

random

[procedure] (random N)

Returns a pseudo-random integer in [0, N-1]. N is an integer.

On Windows, N and the random value are exact integer.

Warning: This procedure uses rand(3) internally and exhibits its deficiencies, including low quality pseudo-randomness:


Previous: Module (chicken process-context)

Next: Module (chicken read-syntax)