finum

Crates.iofinum
lib.rsfinum
version0.4.0
created_at2026-01-18 20:06:30.778347+00
updated_at2026-01-21 20:35:11.851222+00
descriptionA numeric type of variable length (20 decimal digits)
homepage
repository
max_upload_size
id2053001
size208,042
(sanieren823)

documentation

README

finum

This crate aims to solve precision problems for most cases. Numbers are represented by fixed-point integers of variable length.

Usage

Add this to your Cargo.toml:

[dependencies]
fi = "0.4.0"

Precision

The fi crate has a precision of 20 decimal digits. Any number with more than 20 decimal digits will automatically be rounded to 20 decimal digits. The number $2$ is actually $2.000... * 10^{20}$; that way every number is an integer disguised as a decimal numeral.

Operations

This Table shows how precise each Operation is:

Operation Precision
Addition 20 digits
Subtraction 20 digits
Division 20 digits
Logarithm 20 digits
Exponentiation (exponent is an integer) 20 digits
Exponentiation (all cases) ~20 digits
Nth Root ~20 digits
Factorial 15-19 digits
Termial 20 digits
Trigonometry 20 digits
Commit count: 0

cargo fmt