Calculate \(I(x \preceq y) = I(x < y) + 0.5 I(x = y)\)

preceq(x, y)

Arguments

x

numeric

y

numeric

Value

\(I(x \preceq y)\)

Examples

preceq(x = c(0, 0, 0), y = c(-1, 0, 1))
#> [1] 0.0 0.5 1.0
preceq(x = 0, y = c(-1, 0, 1))
#> [1] 0.0 0.5 1.0