411 REFERENCE · Wikibooks
C Sharp Programming/Keywords/unchecked
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
Keywords unchecked
__TOC__</noinclude>
The unchecked keyword prevents overflow-checking when doing integer arithmetics. It may be used as an operator on a single expression or as a statement on a whole block of code.
int x, y, z;
x = 1222111000;
y = 1222111000;
// used as an operator
z = unchecked(x*y);
// used as a statement
unchecked {
z = x*y;
x = z*z;
}