Understanding arithmetic overflow checking in C#
Default context = unchecked By default, arithmetic operations and conversions in C# are executed in an unchecked context. This means that for a signed integer it overflows from int.MaxValue to int.MinValue and underflows from int.MinValue to int.MaxValue, hence both statements below evaluates to true: Similarly, for an unsigned integer it will underflow from 0 to …
Understanding arithmetic overflow checking in C# Read More »