4 releases

0.0.4 Apr 25, 2025
0.0.3 Apr 22, 2025
0.0.2 Apr 22, 2025
0.0.1 Mar 2, 2025
Download history 124/week @ 2025-02-26 23/week @ 2025-03-05 8/week @ 2025-03-12 74/week @ 2025-04-16 293/week @ 2025-04-23

367 downloads per month

MIT license

35KB
721 lines

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

Dependencies

~230–730KB
~17K SLoC