Skip to main content

float_eq

Function float_eq 

Source
pub fn float_eq(a: f64, b: f64) -> bool
Expand description

Compares two floats for equality within EPSILON tolerance.

use wowlab_types::numeric::float_eq;

assert!(float_eq(1.0, 1.0 + 1e-7));
assert!(!float_eq(1.0, 1.1));