1 unstable release
0.1.0 | Jun 13, 2023 |
---|
#1772 in Math
130KB
2.5K
SLoC
Dezimalfestkommazahlrechnung
Features
- Basic unsigned fixed-point arithmetic
- Wrapper types implementing arithmetic traits for convenience, see
UDf64Checked
andUDf64Saturating
- up to 19 effective decimal digits (integer part and fractional combined)
#![no_std]
compatible, no runtime dependencies exceptcore
(except for some tests)- No heap allocations
- Written in straightforward safe Rust, accompanied by an extensive automated test suite
Display
Planned features:
- signed type
TryFrom<&str>
,FromStr
- narrowing/widening casts
Possible future features:
- approximations for:
- square root, higher order roots
- exp, log
- trig functions
- conversion to/from float
NonZero
variantsu32
-based variants- localized
Display
/parse
Non- and anti-goals:
- Choosing precision/width at runtime
- Unchecked/wrapping or panicking API (just use
.unwrap()
) - Performance: All basic operations are implemented with a handful of operations on
u64
oru128
(and overflow checks), so performance should be decent. I don't care enough to make benchmarks though.
Dependencies
~0–620KB
~12K SLoC