Next: randomd, Previous: random, Up: Internal Routines [Contents][Index]
randomb( [seed=seed,] [dimensions] [, /long])
Returns pseudo-random bits in an array with the indicated
dimensions
, which must be either an array, or a set of
scalars. If /long
is specified, then returns a long
array
in which all bits are random. Otherwise, returns a byte
array
with each element set pseudo-randomly to 0
or 1
.
seed
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
you specify a seed
but no dimensions
, then the
seed is set and a scalar 1
is returned.
The random bits are generated using a primitive polynomial modulo 2,
which has a period of 2^31 - 1
, or about 2.1e9
.
Alias: random(/bits)
(if /long
is not set)
See also: random, randomn, randomu, Random Arrays