comparison with nullable types

 

When you perform comparisons with nullable types, if the value of one of the nullable types is null and the other is not, all comparisons evaluate to  false  except for  !=  (not equal).

What happened behind the scene is the IL like :
IL_0029: call???????? instance bool valuetype [mscorlib]System.Nullable`1<valuetype MyValueType>::get_HasValue()
????IL_002e: brtrue.s???? IL_0033 //jump to MyValueType’s operator to compare
????IL_0030: ldc.i4.0???? 
????IL_0031: br.s???????? IL_0040 //leave the default value false for the comparison result.