For nullable value types, the relational operators are also lifted. Comparison of a non-null value to null always results in false, except when inequality is checked:
int? a = 5;int? b = null;bool gt = a > b; // falsebool le = a <= b; // falsebool eq = a == b; // falsebool ne = a != b; // true
Nullable logic can be surprising. For example, if you thought the result of
< would always be exact opposites when applied to the same operands, you can clearly see this doesn’t hold any longer when null is in play.