Next: read, Previous: randomn, Up: Internal Routines [Contents][Index]

`randomu( [seed=`

`seed`, period=`period`,]
`dimensions`)

Returns an array with the specified

, filled with
uniformly distributed pseudo-random numbers. `dimensions`

specifies a seed for the random numbers, and must be non-zero. The same
seed generates the same sequence of pseudo-random numbers every time.
Different seeds generate different sequences. If `seed`

is
not specified, then the returned numbers are `period``double`

and uniformly
distributed between 0 and 1 (exclusive). If a value is assigned to

, then the returned numbers are `period``long`

and
uniformly distributed between `0`

and

(inclusive). If you specify a `period` - 1

but no
`seed`

, then the seed is set and a scalar `dimensions``1`

is
returned.

The method used to generate the pseudo-random numbers with other
distributions is Matsumoto and Nishimura’s “Mersenne Twister” mt19937
generator. The period of this generator is `2^19937 - 1`

, or about
`1e6000`

.

Alias: `random(/uniform)`

See also: random, randomb, randomn, Random Arrays