The first number to compare.
The second number to compare.
Optional
tolerance: numberThe maximum difference allowed between the numbers. Defaults to Constants.DELTA (for regular numbers) or 0n (for bigints).
'true' if the numbers are approximately equal, 'false' otherwise.
equal(3.14159, 3.14, 0.01); // Returns true
equal(10, 15, 0.1); // Returns false
Checks if two bigints are approximately equal within a specified tolerance.
The first bigint to compare.
The second bigint to compare.
Optional
tolerance: bigintThe maximum difference allowed between the numbers. Defaults to 0n .
'true' if the bigint are approximately equal, 'false' otherwise.
equal(2233n, 2233n, 0n); // Returns true
equal(10n, 15n, 1n); // Returns false
Generated using TypeDoc
Checks if two numbers are approximately equal within a specified tolerance.