| Crates.io | finum |
| lib.rs | finum |
| version | 0.4.0 |
| created_at | 2026-01-18 20:06:30.778347+00 |
| updated_at | 2026-01-21 20:35:11.851222+00 |
| description | A numeric type of variable length (20 decimal digits) |
| homepage | |
| repository | |
| max_upload_size | |
| id | 2053001 |
| size | 208,042 |
This crate aims to solve precision problems for most cases. Numbers are represented by fixed-point integers of variable length.
Add this to your Cargo.toml:
[dependencies]
fi = "0.4.0"
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.
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 |