decimal64

Crates.iodecimal64
lib.rsdecimal64
version0.0.7
created_at2025-03-02 22:53:29.660906+00
updated_at2025-06-11 11:06:40.194772+00
descriptionFast fixed point arithmetic that only uses u64 as internal representation.
homepage
repositoryhttps://github.com/HaveFunTrading/decimal64
max_upload_size
id1574942
size75,019
Tom Brzozowski (HaveFunTrading)

documentation

https://docs.rs/decimal64

README

Build Status Crates.io Documentation License: MIT

Decimal64

Fast fixed point arithmetic that only uses u64 as internal representation. Scale is expressed in form of generic ScaleMetrics parameter. Loosely inspired by Java Decimal4j.

Example

let d1 = DecimalU64::<U8>::from_str("123.45").unwrap();
let d2 = DecimalU64::<U8>::from_str("10").unwrap();
let d3 = d1 + d2;
assert_eq!("133.45000000", d3.to_string());
Commit count: 20

cargo fmt