dfkzr 0.1.0

Dezimalfestkommazahlrechnung - decimal fixed point arithmetic with up to 19 digits
Documentation
  • Coverage
  • 100%
    10 out of 10 items documented2 out of 2 items with examples
  • Size
  • Source code size: 181.1 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 3.51 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • hwjsnc

Dezimalfestkommazahlrechnung

Features

  • Basic unsigned fixed-point arithmetic
  • Wrapper types implementing arithmetic traits for convenience, see [UDf64Checked] and [UDf64Saturating]
  • up to 19 effective decimal digits (integer part and fractional combined)
  • #![no_std] compatible, no runtime dependencies except core (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 variants
  • u32-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 or u128 (and overflow checks), so performance should be decent. I don't care enough to make benchmarks though.