LUA and Large Integers

Old bugs stored here for reference.
Locked
User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

LUA and Large Integers

Post by John Adams » Wed Oct 12, 2011 11:15 am

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 ;)

User avatar
Scatman
Retired
Posts: 1688
Joined: Wed Apr 16, 2008 5:44 am
EQ2Emu Server: Scatman's Word
Characters: Scatman
Location: New Jersey

Re: LUA and Large Integers

Post by Scatman » Thu Oct 13, 2011 2:55 am

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?

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: LUA and Large Integers

Post by John Adams » Thu Oct 13, 2011 6:37 am

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!

User avatar
xinux
Team Member
Posts: 680
Joined: Wed Mar 10, 2010 11:10 am
Location: Destroyer of Servers

Re: LUA and Large Integers

Post by xinux » Thu Oct 13, 2011 9:42 am

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) 

-------------------------------------------------------------------------------
EQ II - Build=1360 (Orig) - Build=1360 (DoF) - Build=2654 (KoS) - Build=3375 (Classic) - Build=3554 (EoF)
EQ II - Build=4412 (RoK) - Build=5122 (TSO) - Build=6118 (SF) - Build=7628 (DoV) - Build=8295 (Aod)

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Re: LUA and Large Integers

Post by John Adams » Thu Oct 13, 2011 11:30 am

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)

Locked

Who is online

Users browsing this forum: No registered users and 0 guests