MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / almostEqual

Function almostEqual

graph/floydwarshall_test.go:12–14  ·  view source on GitHub ↗

almostEqual subtracts two float64 variables and returns true if they differ less then float64EqualityThreshold reference: https://stackoverflow.com/a/47969546

(a, b float64)

Source from the content-addressed store, hash-verified

10// almostEqual subtracts two float64 variables and returns true if they differ less then float64EqualityThreshold
11// reference: https://stackoverflow.com/a/47969546
12func 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
17func (a *WeightedGraph) IsAlmostEqualTo(b WeightedGraph) bool {

Callers 2

TestEdmondKarpFunction · 0.85
IsAlmostEqualToMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected