Skip to content

A large integer Rust crate using an approximate representation inspired by scientific notation

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

khonsulabs/approximint

Approximint

Approximint is considered alpha and unsupported crate version Documentation for main

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.

Basic usage

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");

no_std

This crate supports all integer operations, including formatting, in no_std without alloc. Floating point operations require the std feature to be enabled.

Open-source Licenses

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.

About

A large integer Rust crate using an approximate representation inspired by scientific notation

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages