"A library for generating random numbers based on the Mersenne Twister, a pseudorandom number generating algorithm developped by Makoto Matsumoto and Takuji Nishimura (alphabetical order) in 1996/1997."
The module table containing the API.
The version string.
Creates a new
lrand_state
, optionally seeded with a lua integer.
Can also be called from the state
state:clone()
.Clones the state into a new
lrand_state
.
Can also be called from the state
state:seed([seed])
.Reseeds the state with an optional lua integer.
Can also be called from the state
state:randu64()
.Consumes a random unsigned int64 from the state which is returned as a lua integer.
(
raw range: [0, 2^64-1]
) (range in lua: [math.mininteger, math.maxinteger]
)
Can also be called from the state
state:randi64()
.Consumes a random int64 from the state which is returned as a lua integer.
(
raw range: [0, 2^63-1]
) (range in lua: [0, math.maxinteger] (may overflow in 'small lua')
)
Can also be called from the state
state:randd()
.Consumes a random real number from the state which is returned as a lua number.
(
raw range: [0, 1]
) (range in lua: [0,1]
)