Why not make quick work of it and cast them, for the purpose of sanity check, to see what is going on. Example; if ( (unsigned int)var1 >= (unsigned int) var2 ) Then whittle the problem down from there. CCS ought to be ansi, but I believe that C assumes int (16 bit) by default. That one can sneak up on you subtly, like when you use a const in amongst some long variables, and it assumes int. You have to add an L at the end to drive it home. 250 would only be -6 if it were treated as a char, or 8 bit. The definition of short can confuse matters too, as I have seen it applied a few ways. Chris Eddy~ Lawrence Lile wrote: > > Maybe CCS converts them both to signed INTs. In that case -6 (= 250) would > really be less than 0. ????? > -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.