fn approxEqAbs(comptime T: type, x: T, y: T, tolerance: T) bool
[src]
Performs an approximate comparison of two floating point values x
and y
. Returns true if the absolute difference between them is less or equal than the specified tolerance.
The tolerance
parameter is the absolute tolerance used when determining if the two numbers are close enough; a good value for this parameter is a small multiple of floatEps(T)
.
Note that this function is recommended for comparing small numbers around zero; using approxEqRel
is suggested otherwise.
NaN values are never considered equal to any value.