#assert #float #equality #compare #approximimate

no-std approxim

Approximate floating point equality comparisons and assertions

7 releases

new 0.6.6 May 5, 2025
0.6.5 Apr 1, 2025
0.6.4 Mar 22, 2025

#1041 in Rust patterns

Download history 378/week @ 2025-03-17 120/week @ 2025-03-24 321/week @ 2025-03-31 105/week @ 2025-04-07 30/week @ 2025-04-14 165/week @ 2025-04-21 233/week @ 2025-04-28

543 downloads per month
Used in 4 crates (3 directly)

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
~68K SLoC