Skip to content
Pull request Compare This branch is 846 commits behind master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


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 .


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) 

Something went wrong with that request. Please try again.