| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
math.mt-random - Mersenne Twister Random number generator
The random seed value can be given at the instantiation time
by :seed initialization argument, or by using
mt-random-set-seed! described below.
(define m (make <mersenne-twister> :seed (sys-time))) (mt-random-real m) => 0.10284287848537865 (mt-random-real m) => 0.463227748348805 (mt-random-real m) => 0.8628500643709712 ... |
srfi-4 - Homogeneous vectors).
If it is an integer, the lower 32bits are used for initialization.
If it is a u32vector, up to 624 elements are used for initialization.
<mersenne-twister> to continue to generate the pseudo random
sequence.
Mt-random-real doesn't
include 0.0 either, while mt-random-real0 does.
Excluding 0.0 is from the draft SRFI-27.
mt-random-fill-u32vector!, the elements are filled
by exact positive integers between 0 and 2^32-1.
For mt-random-fill-f32vector! and
mt-random-fill-f64vector!, it is filled by an inexact
real number between 0.0 and 1.0, exclusive.
If you need a bunch of random numbers at once, these are much faster than getting one by one.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |