compareFloat {omnibus} | R Documentation |
Compare values to floating-point precision
Description
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
Arguments
x , y |
Numeric |
op |
Operator for comparison (must be in quotes): |
tol |
Tolerance value: The largest absolute difference between |
Value
TRUE
, FALSE
, or NA
Examples
x <- 0.9 - 0.8
y <- 0.8 - 0.7
x < y
x %<% y
compareFloat(x, y, "<")
x <= y
x %<=% y
compareFloat(x, y, "<=")
x == y
x %==% y
compareFloat(x, y, "==")
y > x
y %>% x
compareFloat(y, x, ">")
y >= x
y %>=% x
compareFloat(y, x, ">=")
x != y
x %!=% y
compareFloat(x, y, "!=")
[Package omnibus version 1.2.13 Index]