Search code examples
mathluaprecisionbignum

What is the standard (or best supported) big number (arbitrary precision) library for Lua?


I'm working with large numbers that I can't have rounded off. Using Lua's standard math library, there seem to be no convenient way to preserve precision past some internal limit. I also see there are several libraries that can be loaded to work with big numbers:

  1. http://oss.digirati.com.br/luabignum/
  2. http://www.tc.umn.edu/~ringx004/mapm-main.html
  3. http://lua-users.org/lists/lua-l/2002-02/msg00312.html (might be identical to #2)
  4. http://www.gammon.com.au/scripts/doc.php?general=lua_bc (but I can't find any source)

Further, there are many libraries in C that could be called from Lua, if the bindings where established.

Have you had any experience with one or more of these libraries?


Solution

  • The lmapm library by Luiz Figueiredo, one of the authors of the Lua language.