This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Using unsigned with signed int

I have a signed integer which I have to assign to an unsigned one after addition with unsigned one.

Like

int16_t x = -9;
uint16_t y = 11;

if(x < y)
{ y = y+x;
}

How to ensure that it always result in write opeartion, because signed & unsigned operation scombined form wrong values.