Skip to content

isCloseAbsolute

isCloseAbsolute(a, b, absTolerance): boolean

Defined in: packages/core/src/number/is-close-absolute.ts:17

Tests whether two numbers are within an absolute tolerance of each other: `|a

  • B| <= absTolerance`.

The only form defined at the origin, and therefore the one to reach for when the operands may straddle zero — a determinant about to be divided by, a distance about to be normalised. It needs a tolerance meaningful in the caller’s units, so it degrades once the operands are far from that scale; isCloseTo pairs it with a relative bound for that case.

number

The first number to compare.

number

The second number to compare.

number

The absolute tolerance, in the operands’ own units.

boolean

true if the numbers are within absTolerance, false otherwise.