almostEqual subtracts two float64 variables and returns true if they differ less then float64EqualityThreshold reference: https://stackoverflow.com/a/47969546
(a, b float64)
| 10 | // almostEqual subtracts two float64 variables and returns true if they differ less then float64EqualityThreshold |
| 11 | // reference: https://stackoverflow.com/a/47969546 |
| 12 | func almostEqual(a, b float64) bool { |
| 13 | return math.Abs(a-b) <= float64EqualityThreshold |
| 14 | } |
| 15 | |
| 16 | // IsAlmostEqualTo verifies if two WeightedGraphs can be considered almost equal |
| 17 | func (a *WeightedGraph) IsAlmostEqualTo(b WeightedGraph) bool { |
no outgoing calls
no test coverage detected