comparison of two unsigned bytes strange behavior

UKHeliBob:
My suspicion is that the calculation is being done using integers

You mean "int"s - the variables already are integers