lua-users home
lua-l archive

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


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.