4 releases

new 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 133/week @ 2025-02-28 15/week @ 2025-03-07 7/week @ 2025-03-14 157/week @ 2025-04-18

157 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

~225–730KB
~17K SLoC