Function approx_eq

Source
pub fn approx_eq(a: f32, b: f32) -> bool
Expand description

Performs an approximate equality comparison using the module’s default EPSILON.

§Examples

use khora_core::math::{approx_eq, EPSILON};
assert!(approx_eq(1.0, 1.0 + EPSILON / 2.0));
assert!(!approx_eq(1.0, 1.0 + EPSILON * 2.0));