@node Random
@subsection Random Number Generation
+Pseudo-random numbers are generated from a random state object, which
+can be created with @code{seed->random-state}. The @var{state}
+parameter to the various functions below is optional, it defaults to
+the state object in the @code{*random-state*} variable.
+
@deffn {Scheme Procedure} copy-random-state [state]
@deffnx {C Function} scm_copy_random_state (state)
Return a copy of the random state @var{state}.
number of the same type between zero (inclusive) and
@var{n} (exclusive). The values returned have a uniform
distribution.
-
-The optional argument @var{state} must be of the type produced
-by @code{seed->random-state}. It defaults to the value of the
-variable @code{*random-state*}. This object is used to maintain
-the state of the pseudo-random-number generator and is altered
-as a side effect of the random operation.
@end deffn
@deffn {Scheme Procedure} random:exp [state]
Return a new random state using @var{seed}.
@end deffn
+@defvar *random-state*
+The global random state used by the above functions when the
+@var{state} parameter is not given.
+@end defvar
+
@node Characters
@section Characters