almost_zero: Test if values of a vector are almost zero

Description Usage Arguments Value See Also Examples

View source: R/almost_zero.R

Description

The function almost_zero tests if values of the numeric vector x are equal to zero up to a tolerance.

Usage

1
2
3
almost_zero(x, tolerance = sqrt(.Machine$double.eps))

almost.zero(x, tolerance = sqrt(.Machine$double.eps))

Arguments

x

numeric. The vector of numeric values at stake.

tolerance

numeric. Differences smaller than tolerance are considered as equal. The default value is close to 1.5e-8.

Value

A logical vector of the same length as x.

See Also

all.equal.

Examples

1
almost_zero(c(0, 10^(-7), 10^(-8)))

paulponcet/bazar documentation built on July 15, 2019, 5:28 a.m.