The first number for the calculation.
The second number for the calculation.
The direction of the calculation. If "max", the values of a
and b
are switched.
The tolerance level to check if a
and b
are approximately equal.
a
and b
.
If a
and b
are approximately equal (within tol
), it returns 0.
If the minimum absolute value of a
and b
is less than tol
, or if either a
or b
is Infinity,
or if a
and b
have different signs, or if either a
or b
is NaN, it returns Infinity.
Otherwise, it returns the relative difference between a
and b
divided by the minimum absolute
value of a
and b
, rounded to 7 decimal places.
If the result is -0, it converts it to 0.Generated using TypeDoc
This function calculates the gap between two numbers,
a
andb
, based on the given directiondir
and tolerancetol
.