[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: statistics in Lua
- From: Khaled Abduljalil <k.abduljalil@...>
- Date: Wed, 30 Nov 2011 13:43:07 +0000
Thank you very much for your feedback and the link to those libraries and tools. I will try the math one as well.
From: email@example.com [mailto:firstname.lastname@example.org] On Behalf Of Luiz Henrique de Figueiredo
Sent: 30 November 2011 13:14
To: Lua mailing list
Subject: Re: statistics in Lua
> 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.