Indeed b
is converted to unsigned. However what you observed is that b
converted to unsigned and then added to 10 gives as value 5.
On x86 32bit this is what happens
b
, coverted to unsigned, becomes4294967291
(i.e.2**32 - 5
)- adding 10 becomes 5 because of wrap-around at
2**32
(2**32 - 5 + 10 = 2**32 + 5 = 5
)