MCPcopy Create free account
hub / github.com/PerroEngine/Perro / nearly_eq

Function nearly_eq

perro_source/api_modules/perro_modules/src/math.rs:281–283  ·  view source on GitHub ↗
(a: f32, b: f32, epsilon: f32)

Source from the content-addressed store, hash-verified

279
280#[inline]
281pub fn nearly_eq(a: f32, b: f32, epsilon: f32) -> bool {
282 (a - b).abs() <= epsilon.abs()
283}
284
285#[cfg(test)]
286#[path = "../tests/unit/math_tests.rs"]

Callers 1

Calls 1

absMethod · 0.45

Tested by 1