Meets the limit
64-bitTrue, false or null for a found value against a rule.
min − e ≤ found ≤ max + e
Both bounds are widened by the same absolute tolerance for the unit before comparing, so a value that misses a limit by less than the tolerance passes. Null is returned for a missing or non-finite value instead of a verdict.
export const EPS = { mm: 1e-6, pct: 1e-9, m2: 1e-9, r: 1e-6, u: 1e-9, ratio: 1e-9 };
export function judge(rule, found) {
if (found === null || !Number.isFinite(found)) return null;
const { min, max } = ruleBounds(rule), e = EPS[rule.unit] || 0;
return (min === null || found >= min - e) && (max === null || found <= max + e);