A simple arbitrary precision library for Lua, based on code from GNU bc
C Lua
Latest commit 93ca33c Feb 18, 2013 @drahosp drahosp Updated travis hook


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:

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

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)