Page 1 of 1
LUA and Large Integers
Posted: Wed Oct 12, 2011 11:15 am
by John Adams
Scat, I was clicking around the interwebs for some other info, and stumbled across some posts about "long longs" and LUA.
The Question:
http://lua-users.org/lists/lua-l/2006-08/msg00385.html
Couple replies later, a possible solution?
http://lua-users.org/lists/lua-l/2006-08/msg00388.html
http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/
If this has nothing to do with our issue with large grid_id's, then let me know so I stop looking into it

Re: LUA and Large Integers
Posted: Thu Oct 13, 2011 2:55 am
by Scatman
Yeah if such a library exists to support 64 bit integers, that would solve our grid_id problem. Which library is it though, do you know? I didn't see any that suggest a big number library? Unless it's integrated into one of the math libraries?
Re: LUA and Large Integers
Posted: Thu Oct 13, 2011 6:37 am
by John Adams
Yeah, I hit that guy's link and my eyes glazed over, so I was hoping it would be clearer to you heh. We'll keep lookin!
Re: LUA and Large Integers
Posted: Thu Oct 13, 2011 9:42 am
by xinux
Look's liked he used this one.
http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/#lbc
which does the following according to the readme.
Code: Select all
This is a big-number library for Lua 5.1. It is based on the arbitrary
precision library number.c written by Philip A. Nelson for GNU bc-1.06:
http://www.gnu.org/software/bc/
To try the library, just edit Makefile to reflect your installation of Lua and
then run make. This will build the library and run a simple test. For detailed
installation instructions, see
http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/install.html
There is no manual but the library is simple and intuitive; see the summary
below. Read also test.lua, which shows the library in action.
This code is hereby placed in the public domain, except number.c and number.h,
which are subject to GPL.
Please send comments, suggestions, and bug reports to lhf@tecgraf.puc-rio.br .
-------------------------------------------------------------------------------
bc library:
__add(x,y) __pow(x,y) digits([n]) mul(x,y) sub(x,y)
__div(x,y) __sub(x,y) div(x,y) neg(x) tonumber(x)
__eq(x,y) __tostring(x) divmod(x,y) number(x) tostring(x)
__lt(x,y) __unm(x) isneg(x) pow(x,y) trunc(x,[n])
__mod(x,y) add(x,y) iszero(x) powmod(x,y,m) version
__mul(x,y) compare(x,y) mod(x,y) sqrt(x)
-------------------------------------------------------------------------------
Re: LUA and Large Integers
Posted: Thu Oct 13, 2011 11:30 am
by John Adams
Nice. Thanks, Xinux. Maybe we can finally set up our Locations properly.
(btw, I was looking into this because while adding locations to zones, I wanted to implement Disco POIs)