Why dividing int.MinValue by -1 threw OverflowException in unchecked context?
int y = -2147483648; int z = unchecked(y / -1); The second line causes an OverflowException . Shouldn't unchecked prevent this? For example: int y = -2147483648; int z = unchecked(y * 2); doesn't cause an exception. This is not an exception that the C# compiler or the jitter have any control over. It is specific to Intel/AMD processors, the CPU generates a #DE trap (Divide Error) when the IDIV instruction fails. The operating system handles the processor trap and reflects it back into the process with a STATUS_INTEGER_OVERFLOW exception. The CLR dutifully translates it to a matching managed