(first, second model.SampleValue, tolerance float64)
| 206 | } |
| 207 | |
| 208 | func compareSampleValue(first, second model.SampleValue, tolerance float64) bool { |
| 209 | f := float64(first) |
| 210 | s := float64(second) |
| 211 | |
| 212 | if math.IsNaN(f) && math.IsNaN(s) { |
| 213 | return true |
| 214 | } else if tolerance <= 0 { |
| 215 | return math.Float64bits(f) == math.Float64bits(s) |
| 216 | } |
| 217 | |
| 218 | return math.Abs(f-s) <= tolerance |
| 219 | } |