Equals asserts that the float equals v with ± tolerance.
(v, tolerance float64)
| 38 | |
| 39 | // Equals asserts that the float equals v with ± tolerance. |
| 40 | func (o OnFloat) Equals(v, tolerance float64) bool { |
| 41 | min, max := v-tolerance, v+tolerance |
| 42 | return o.Compare(o.value, "in", min, "to", max).Test(o.value >= min && o.value <= max) |
| 43 | } |