LANGUAGE

unchecked overflow context

Explicitly selects unchecked behavior; integral narrowing preserves low bits. Not a general way to suppress exceptions.

Formal Syntax & Structure

csharp syntaxcsharp
unchecked(expression)

Working Example

Example Snippetcsharp
long wide = 2147483648L; int n = unchecked((int)wide);
C# & .NET Reference