This is a simple arbitrary arithmetic library that interoperates will all of Rust's primitive integer types ({u,i}{8,16,32,64,128}
). I built it to learn how to use Rust's FFI mechanisms, specifically using bindgen
and cc
. @kornel's post on -sys
libraries was very helpful.
Pros:
- Easy to use
- Has
Integer
andRational
types. - Wrapper over the
imath
library, can converts types to and from.
Cons:
- heavy use of allocation, each
Integer
/Rational
is allocated on the heap. - Performance is likely worse than crates such as
rug
,num-bigint
, orramp
.