A large integer library supporting a non-inclusive range of (-1e4,294,967,305..+1e4,294,967,305) with 9 decimal digits of precision.
This library was designed to be a simple, efficient implementation of large
numbers for use in incremental games. It utilizes two 32 bit integers to
represent a number in the form of coefficient * 10^exponent
.
use approximint::Approximint;
let googol = Approximint::one_e(100);
let billion = Approximint::new(1_000_000_000);
assert_eq!((googol * billion).to_string(), "1.000e109");
assert_eq!((googol * billion).as_english().to_string(), "1 billion googol");
This crate supports all integer operations, including formatting, in no_std
without alloc. Floating point operations require the std
feature to be
enabled.
This project, like all projects from Khonsu Labs, is open-source. This repository is available under the MIT License or the Apache License 2.0.
To learn more about contributing, please see CONTRIBUTING.md.