It’s best to make sure your types match in advance. But if you cannot:
If you know that it intwill definitely not have a negative value at this point, draw it on unsigned.
If you know that the value unsignedwill be less than INT_MAX, translate it into int.
If neither of them is held, translate both values into a type that is large enough to hold all possible values that need to be processed. Another possibility (when there is no sufficiently large type) is to use two comparisons: first compare intwith 0, and if it is non-negative, add it to unsignedand compare with the value unsigned.
, int unsigned, , , .
int unsigned , int . - , unsigned, .