ApproxEq is used to provide an approximate equality for the type you want, but your type must implement the approx trait itself. By default, f32 and f64 have an implementation with tolerances of 1e-3 and 1e-6, respectively.
f32
f64
1e-3
1e-6