#assert #equality #float #compare #approximimate

no-std approxim

Approximate floating point equality comparisons and assertions

6 releases

0.6.5 Apr 1, 2025
0.6.4 Mar 22, 2025

#840 in Rust patterns

Download history 455/week @ 2025-03-19 79/week @ 2025-03-26 376/week @ 2025-04-02 21/week @ 2025-04-09

931 downloads per month
Used in 2 crates

Apache-2.0

58KB
1K SLoC

approxim

Test Crate License Apache Docs Minimum rustc version Codecov

This is a fork of the popular approx crate. Approximate floating point equality comparisons and assertions for the Rust Programming Language.

Replace approx

To act as a drop-in replacement for approx, one can use the renaming option provided by cargo.

# Cargo.toml
[dependencies]
approx = { package = "approxim", version = "CURRENT_VERSION" }

Note that no further changes are required. Derive macros should also work with this workaround.

Dependencies

~2.2–3MB
~67K SLoC