> Unsigned ints have no “negativity” semantic.
They do. The code:
unsigned x; unsigned y = -x;
https://stackoverflow.com/q/8026694/1593077
That’s not a negativity semantic, it’s the behavior of the “-“ operator. If you print y or compare it to zero you will see that the result remains positive. Unsigned integers by definition have no negative semantic, hence the name.
That’s not a negativity semantic, it’s the behavior of the “-“ operator. If you print y or compare it to zero you will see that the result remains positive. Unsigned integers by definition have no negative semantic, hence the name.