Checked and Unchecked (C# Reference)
Updated: July 20, 2015
For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.
C# statements can execute in either checked or unchecked context. In a checked context, arithmetic overflow raises an exception. In an unchecked context, arithmetic overflow is ignored and the result is truncated.
unchecked is specified, the default context depends on external factors such as compiler options.
The following operations are affected by the overflow checking:
Expressions using the following predefined operators on integral types:
Explicit numeric conversions between integral types.
The /checked compiler option lets you specify checked or unchecked context for all integer arithmetic statements that are not explicitly in the scope of a