approx_equal: Approximate equal

Description Usage Arguments Value Examples

View source: R/utility_functions.R

Description

Compute whether x and y are approximately equal given a tolerance level

Usage

1
2
3
approx_equal(x, y, tol = .Machine$double.eps^0.5)

x %~% y

Arguments

x

Numeric scalar.

y

Numeric scalar.

tol

Tolerance.

Value

Boolean

Examples

1
2
3
approx_equal(1, 1)
1 %~% (1 + 1e-16)
1 %~% 1.01

HuraultMisc documentation built on Sept. 6, 2021, 9:09 a.m.