[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: One more question



Christian Reiniger wrote:
> 
> Philipp Gühring wrote:
>  
> >if ((unsigned)10+a-b)<20)
> 
> stripping the sign bit from 10 won't help much ;)
> 
> I guess you mean
> 
> if ((unsigned)(10 + a - b)) < 20)
> 
> (Or *do* casts have such a low precedence?? Would be weird IMHO..)
> 


It is not the precedence but the type conversion rules.

unsigned + int == unsigned


			Eero