These functions compare values while accounting for differences in floating point precision.
Usage
compareFloat(x, y, op, tol = .Machine$double.eps^0.5)
x %<% y
x %<=% y
x %==% y
x %>=% y
x %>% y
x %!=% y
Examples
x <- 0.9 - 0.8
y <- 0.8 - 0.7
x < y
#> [1] TRUE
x %<% y
#> [1] FALSE
compareFloat(x, y, "<")
#> [1] FALSE
x <= y
#> [1] TRUE
x %<=% y
#> [1] TRUE
compareFloat(x, y, "<=")
#> [1] TRUE
x == y
#> [1] FALSE
x %==% y
#> [1] TRUE
compareFloat(x, y, "==")
#> [1] TRUE
y > x
#> [1] TRUE
y %>% x
#> [1] FALSE
compareFloat(y, x, ">")
#> [1] FALSE
y >= x
#> [1] TRUE
y %>=% x
#> [1] TRUE
compareFloat(y, x, ">=")
#> [1] TRUE
x != y
#> [1] TRUE
x %!=% y
#> [1] FALSE
compareFloat(x, y, "!=")
#> [1] FALSE