MCPcopy Create free account
hub / github.com/gavv/httpexpect / deltaRelativeErrorCheck

Function deltaRelativeErrorCheck

number.go:1351–1365  ·  view source on GitHub ↗
(inDeltaRelative bool, number, value, delta float64)

Source from the content-addressed store, hash-verified

1349}
1350
1351func deltaRelativeErrorCheck(inDeltaRelative bool, number, value, delta float64) bool {
1352 if (number == 0 || math.IsInf(number, 0)) && value != number {
1353 return true
1354 }
1355 if math.Abs(number-value)/math.Abs(number) > delta {
1356 if inDeltaRelative {
1357 return true
1358 }
1359 } else {
1360 if !(inDeltaRelative) {
1361 return true
1362 }
1363 }
1364 return false
1365}

Callers 2

InDeltaRelativeMethod · 0.85
NotInDeltaRelativeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…