lua-users home
lua-l archive

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


Hallo,

On 5/24/06, Jose Marin <jose_marin2@yahoo.com.br> wrote:
Overflow could be a problem in this algorithm?
If x became near MAX_INT, what happens on the next
multiplication ?


    You could use x=a*x+c % VERY_LARGE_INT, but of course the numbers
will wrap.

--
-alex
http://www.ventonegro.org/