[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |

`srfi-27`

- Sources of Random Bits __Module:__**srfi-27**-
This module provides SRFI-27 pseudo random generator interface,
using Mersenne Twister algorithm
(See section 11.8
`math.mt-random`

- Mersenne Twister Random number generator) as the backbone.

__Function:__**random-integer***n*- [SRFI-27]
Returns a random exact integer between [0,
`n`-1], inclusive, using the default random source. To set a random seed for this procedure, use`random-source-randomize!`

or`random-source-pseudo-randomize!`

on`default-random-source`

.

__Function:__**random-real**- [SRFI-27]
Returns a random real number between (0, 1), exclusive,
using the default random source.
To set a random seed for this procedure, use
`random-source-randomize!`

or`random-source-pseudo-randomize!`

on`default-random-source`

.

__Variable:__**default-random-source**- [SRFI-27]
Keeps the default random source that is used by
`random-integer`

and`random-real`

.

__Function:__**make-random-source**- [SRFI-27]
Creates and returns a new random source.
In the current Gauche implementation, it is just a
`<mersenne-twister>`

object. It may be changed in the future implementation.

__Function:__**random-source?***obj*- [SRFI-27]
Returns
`#t`

if`obj`is a random source object.

__Function:__**random-source-state-ref***s*__Function:__**random-source-state-set!***s state*- [SRFI-27]
Gets and sets the "snapshot" of the state of the random source
`s`.`State`is an opaque object whose content depends on the backbone generator.

__Function:__**random-source-randomize!***s*- [SRFI-27]
Makes an effort to set the state of the random source
`s`to a truly random state. The current implementation uses the current time and the process ID to set the random seed.

__Function:__**random-source-pseudo-randomize!***s i j*- [SRFI-27]
Changes the state of the random source
`s`into the initial state of the (`i`,`j`)-th independent random source, where`i`and`j`are non-negative integers. This procedure can be used to reuse a random source`s`as large number of independent random source, indexed by two non-negative integers. Note that this procedure is entirely deterministic.

__Function:__**random-source-make-integers***s*- [SRFI-27]
Returns a procedure, that takes one integer argument
`n`and returns a random integer between 0 and`n`-1 inclusive for every invocation, from the random source`s`.

__Function:__**random-source-make-reals***s &optional unit*- [SRFI-27]
Returns a procedure, that takes no argument and
returns a random real between 0 and 1 exclusive for
every invocation, from the random source
`s`. If`unit`is given, the random real the returned procedure generates will be quantized by the given`unit`, where 0 <`unit`< 1.

[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |

This document was generated by