#math #analysis #determinism

tokmd-math

Deterministic numeric and statistical helpers for tokmd microcrates

2 stable releases

Uses new Rust 2024

new 1.7.3 Mar 6, 2026
1.7.2 Feb 25, 2026

#2720 in Development tools


Used in 13 crates (4 directly)

MIT/Apache

21KB
65 lines

tokmd-math

Single-responsibility microcrate for deterministic numeric helpers used across tokmd analysis crates.

API

  • round_f64(value, decimals) - deterministic decimal rounding helper
  • safe_ratio(numer, denom) - zero-safe ratio helper (4 decimal places)
  • percentile(sorted, pct) - percentile lookup over sorted integer values
  • gini_coefficient(sorted) - inequality coefficient for sorted integer values

Guarantees

  • deterministic for identical inputs
  • no allocation for core operations
  • no unsafe code

No runtime deps