lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On 20/07/2018 23:50, Albert Chan wrote:

math.randomseed (x [, y])

Sets x and y as the "seed" for the pseudo-random generator: equal seeds produce equal sequences of numbers. The default for y is zero.

Does anyone knows what's the purpose of the y argument, besides making the seed "bidmensional".


-- Lorenzo

It allowed for up to 2^128 different seeds.

Thanks! Yes, it makes sense.

Anyway I think that this info should be spelled out clearly in the manual, to avoid people being puzzled.

Suggestion for Lua team: a simple sentence like the following should suffice.

"y allows, together with x, to specify 2^128 different seeds, unlike previous version of Lua."

BTW, this should be mentioned in the language changes section of the manual (for someone might be important to being able to generate up to 2^128 different "deterministic" sequences).


-- Lorenzo