cmpFloat

Compare two float point numbers with assuming that are equal if are in range of maxAbsDiff

int
cmpFloat
(
T = float
U = float
)
(
in T a
,
in U b
,
T maxRelDiff = 1e-2
,
T maxAbsDiff = 1e-5
)

Parameters

a T

A float point number

b U

Other float point

maxRelDiff T

Max relative difference

maxAbsDiff T

Max absoulte difference Returns If _a are aproximated equal that _b, returns 0. Otherwise, if _a > _b, returns 1 and if _a < _b , returns -1;

Meta