Re: PRNG for Lua 4.0?
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: PRNG for Lua 4.0?
- From: Dirk Laurie <dirk.laurie@...>
- Date: 2013年9月10日 16:39:08 +0200
2013年9月10日 Michael Horvath <mikh2161@gmail.com>:
> The output is "24".
OK. That means you have 24-bit floating-point.
You can use the same code, but you will have to make all
the constants much smaller. The a,c,m values must be
small enough that a*(m-1) + c is less than 2^24.
Do you have access to Knuth's Art of Computer Programming,
Volume 2? I think he has some tables of good a,c,m values
for low-precision machines.