Test whether elements in vector x are effectively zero, within the square root of machine tolerance for a floating point number.

almostZero(x, y = 0, tolerance = sqrt(.Machine$double.eps))

Arguments

x

Numeric vector of values to compared against 0

y

Value to be compared against. Default is 0.

tolerance

The maximum difference between x and y necessary to call a value non-zero

Value

TRUE or FALSE for each element of the vector x.

Details

Returns TRUE for all vector elements that are within rounding error of zero.