validate icon indicating copy to clipboard operation
validate copied to clipboard

Negated inequality does not take rounding into account

Open edwindj opened this issue 3 years ago • 1 comments

library(validate)
rules <- validator(!(x > 0))
rules2 <- validator(x <= 0)

dat <- data.frame(x = 1.001)
summary(confront(dat, rules, lin.ineq.eps=0.01))
##   name items passes fails nNA error warning expression
## 1   V1     1      0     1   0 FALSE   FALSE   !(x > 0)
summary(confront(dat, rules2, lin.ineq.eps=0.01))
##   name items passes fails nNA error warning      expression
## 1   V1     1      0     1   0 FALSE   FALSE (x - 0) <= 0.01

See also #136 : would be fixed when sub expressions are taken into account

edwindj avatar Jun 29 '21 15:06 edwindj

Thanks to Sigrid van Hoek for noticing!

edwindj avatar Jun 29 '21 15:06 edwindj