function matchesExpected(actual, expected) { return Math.abs(actual - expected) <= Number.EPSILON; } console.log(matchesExpected(1_000_000_000, 1_000_000_000.0001));