[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: The probability of returning zero by math.random is doubled.
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Fri, 19 Sep 2008 09:08:30 -0300
> Much better generators exist. My favorite is the 'Well' generator:
Too bad it cannot be used for commercial purposes without negociation.
(The very first version of Lua was released with exactly the same restriction;
it did not work at all.)
Also, the code in that web page has no documentation at all. In particular,
it's not clear which version to choose, even after looking at the paper.
Finally, the code itself could use a better packaging, without static
variables. Also, the need to have to supply a seed in the form of a long
array of ints is not very convenient.
Don't get me wrong. The WELL generator is short code that seems to perform
quite well. (I'm not an RNG expert.) It's just that, as it is, it cannot be
used easily in Lua.