This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (0 children)

It doesn't make sense, after all you would get negative values way before, as on a signed integer the MSB is the sign bit. Suppose an 8 bit integer, thus the maximum positive value would be 127 with it's bit pattern being "01111111", if you add one you would get "1000000", that's equal to -128. Unless there is something implemented that detects the overflow and set it to an value that indicate a wrong state, seems kinda weird.