Spot the bug in measurement comparison

from Floating-point arithmetic
Node 24 intermediate 4 min 1 issue to find

Find the comparison bug in this generated measurement check.

JavaScript
function matchesExpected(actual, expected) {
  return Math.abs(actual - expected) <= Number.EPSILON;
}

console.log(matchesExpected(1_000_000_000, 1_000_000_000.0001));
Open in playground
Report an error