You can also just compute a diff and then just check if it is still in range
let a = 3.0; let b = 2.9999999999; let diff = a - b; assert_eq!(diff < 0.000001, diff > -0.000001);