-
gmp-wasm
Fork of the GNU Multiple Precision Arithmetic Library (GMP), suitable for compilation into WebAssembly.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
For the best 5 years I've been writing Malachite, a library that provides bignum Naturals, Integers, and Rationals. Now that it has approximate feature parity with other bignum Rust libraries, I'm ready to release it. You can find links to crates.io and docs.rs at www.malachite.rs.
Malachite's secret sauce is that a good portion of its code (40 to 50%, if I had to guess) is translated from GMP's and FLINT's C code into safe Rust. The resulting code is complex, but thoroughly tested; Malachite has 4,297 unit tests and 1,652 doctests. I've shown the results of some benchmarks here, but I highly encourage you to make your own benchmarks too! The general trend is that Malachite is (often significantly) faster than num, and slower than GMP (which has been around for decades and is very highly optimized).
I've been sitting on my hands when it comes to updating my library, but if you really want a fast test, you can use some of my research/implementation for RCPrime, with creditation of course. I'm not sure what algorithms FLINT uses, but I'm fairly certain that the RCPrime implementation is the most efficient for integers less than 2^35 (requiring 64 multiplications and only one strong fermat test) even if you implement with Montgomery exponentiation.
I believe rust-decimal has float representation. If not Rust-CAS supports float with (via the Mpf struct) functions for addition/subtraction, multiplication/division, exponentiation and sqrts. I haven't officially released it (and won't for a while) so it's a mess of inefficient functions with no documentation but if you really want it it's functional. (I believe printing negative floats less than 1 is broken in that version)
I'm adding your crate to the bigint benchmark, you can find some results on the PR page.
Related posts
-
🔥 Meet genson-rs: Blazing-Fast JSON Schema Generation for Gigabytes of Data! 🚀
-
Genson-Rs: Fast JSON Schema Generation for Large Datasets in Rust
-
Monorepo architecture in shadcn-ui/ui.
-
BEAM VM The good, the bad and the ugly
-
Experimenting with generics in Rust: little library for Bezier curves - part 1