Is C#/.NET signed integer overflow behavior defined?
From the spec:
4.1.5 Integral Types
The checked and unchecked operators and statements are used to control overflow checking for integral-type arithmetic operations and conversions (§7.6.12). In a checked context, an overflow produces a compile-time error or causes a System.OverflowException to be thrown. In an unchecked context, overflows are ignored and any high-order bits that do not fit in the destination type are discarded.
That is the only description of the behavior that I could find, but it seems sufficient. So yes, adding one to Int32.MaxValue
will result in the value Int32.MinValue
using two's complement representation.