Skip to content

Latest commit

 

History

History
41 lines (28 loc) · 1.59 KB

README.md

File metadata and controls

41 lines (28 loc) · 1.59 KB

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.