If you have a signed integer
int x = any
And then state that
x < 0
Is the following statement true or false?
((x*2) < 0)
The answer is false, which seems counter intuitive. Is it because X can be any negative value, it can also be a very big negative value which will overflow if multiplied by two.
So if I have the number -30768
which multiplied by 2 is -61536
But because we only have 16 bits the last 16 are taken resulting in
0000111110100000 which is positive.
Is this the correct explanation? I can't seem to find a good source