Registry / testing / approx

approx

JSON →
library0.5.1rscratesunverified

Approximate floating point equality comparisons and assertions.

# Cargo.toml [dependencies] approx = "0.5.1"
INSTALL
IMPORT
SIG · APPROX
A
approx
testingrustv0.5.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

assert_relative_eq
use approx::assert_relative_eq;

Asserts that two floats are approximately equal within a relative epsilon.

use approx::assert_relative_eq; fn main() { let a = 1.0000001; let b = 1.0; assert_relative_eq!(a, b, epsilon = 1e-6); }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.5.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
42 hits · last 30 days
node
38
OpenAI (training)
1
Resources
approx — cargo add approx · libregistry