Re: statistics in Lua
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: statistics in Lua
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: 2011年11月30日 11:13:58 -0200
> Does anybody know any ready codes for statistical functions in Lua, random generation, ...?
For random number generation using the uniform distribution Lua has a
built-in function math.random. See also math.randomseed.
Lua's math.random uses the random number generator provided by the C library.
Historically, this generator was not very good, but in recent C libraries,
e.g. the GNU C library, this generator is much better. If you need to
make sure you're using a better random number generator, try my lrandom
at http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/#lrandom which uses the
Mersenne Twister.