Murl Engine Lua Addon API  Version 1.0 beta
Murl.Util.Marsaglia

The marsaglia random number generator.

The marsaglia generator has low quality with a period of 2^32 only, but calculates fast results and uses 32 bit state memory only. The better choice with an acceptable overhead is the TT800 or Well1024 class.


Table members

Inherited


Murl.Util.Rng

Functions


Murl.Util.Marsaglia.new()

The default constructor. Seed() the random number generator with the current time nanoseconds fraction.

Murl.Util.Marsaglia new()

Returns
Murl.Util.Marsaglia

Murl.Util.Marsaglia.new(seed)

Constructor taking a seed value.

Murl.Util.Marsaglia new(Integer seed)

Parameters
seedThe seed value.
Returns
Murl.Util.Marsaglia


Methods


Seed(seed)

Seed the random number generator.

Seed(Integer seed)

Parameters
seedThe seed value.

Rand()

Get a random number in the full UInt32 range.

Integer Rand()

Returns
Integer The random number.