MCPcopy Create free account
hub / github.com/josdejong/mathjs / assertApproxEqual

Function assertApproxEqual

test/benchmark/expression_parser.js:72–76  ·  view source on GitHub ↗
(actual, expected, tolerance)

Source from the content-addressed store, hash-verified

70}
71
72function assertApproxEqual (actual, expected, tolerance) {
73 const diff = Math.abs(expected - actual)
74 if (diff > tolerance) assert.strictEqual(actual, expected)
75 else assert.ok(diff <= tolerance, actual + ' === ' + expected)
76}

Callers 1

Calls 1

absMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…