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 |
157 downloads per month
35KB
721 lines
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