lua-users home
lua-l archive

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


On Sat, Mar 22, 2014 at 8:21 AM, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
>> Among many programming circles, rand() is considered harmful.
>
> The Lua manual warns about this. Note that it says that the quality
> of math.random() cannot be guaranteed, not that it must be bad.
>
> I seemed to recall that recent glibc had a much better rand() but
> I can't find the source of that quote and the glibc sources do not show
> a better RNG. (My recollection was that rand() actually was drand48() or
> random() but the sources do not show it.)
>

Would it not be safe to assume rand() is a wrapper around something
better within the C library?  The risk is using rand() on older
systems.