1
1
# Lua Bint
2
2
3
- Small portable arbitrary precision integer arithmetic library in pure Lua for
3
+ Small portable arbitrary- precision integer arithmetic library in pure Lua for
4
4
computing with large integers.
5
5
6
6
Different from most arbitrary-precision integer libraries in pure Lua out there this one
7
7
uses an array of lua integers as underlying data-type in its implementation instead of
8
- using strings or large tables, so regarding that aspect this library should be more efficient.
8
+ using strings or tables of digits , so regarding that aspect this library should be more efficient.
9
9
10
10
The library implementation was highly inspired by
11
11
[ tiny-bignum-c] ( https://github.com/kokke/tiny-bignum-c ) .
@@ -30,6 +30,11 @@ when using the proper methods.
30
30
All the lua arithmetic operators (+, -, * , //, /, %) and bitwise operators (&, |, ~ , <<, >>)
31
31
are implemented as metamethods.
32
32
33
+ The integer size must be fixed in advance and the library is designed to be efficient only when
34
+ working with integers of sizes between 64-4096 bits. If you need to work with really huge numbers
35
+ without size restrictions then use other library. This choice has been made to have more efficiency
36
+ in that specific size range.
37
+
33
38
## Features
34
39
35
40
* Small, simple and self contained
@@ -85,8 +90,9 @@ To check if everything is working as expected under your machine run `lua tests.
85
90
86
91
## Limitations
87
92
88
- It is intended only to be used in Lua 5.3 and 5.4. The library can theoretically be backported
89
- to Lua 5.1/LuaJIT but there is no plan at the moment.
93
+ It is intended only to be used in Lua 5.3+.
94
+ The library can theoretically be backported to Lua 5.1/LuaJIT but there is no plan at the moment.
95
+ The integer size is limited in advance, this is a design choice.
90
96
91
97
## License
92
98
0 commit comments