A three-way comparison takes two values A and B determines whether A < B, A = B, or A > B in a single operation.

lhs %<=>% rhs

Arguments

lhs

Left hand side operator

rhs

Rand hand side operator

Value

Greater value or zero if equal.

Examples

1 %<=>% 2
#> [1] 2
2 %<=>% 1
#> [1] 2
3 %<=>% 3
#> [1] 0