using static System.Console;
WriteLine("n is an IntPtr");
throw new Exception("Should not get here.");
catch (OverflowException) { }
WriteLine("n is a float");
throw new Exception("Should not get here.");
catch (OverflowException) { }
WriteLine("n is a double");
throw new Exception("Should not get here.");
catch (OverflowException) { }
WriteLine("n is a long, but filled with int.MaxValue (we're cheating a little bit here)");
throw new Exception("Should not get here.");
catch (OverflowException) { }
throw new Exception("Should not get here.");
catch (OverflowException) { }
throw new Exception("Should not get here.");
catch (OverflowException) { }
throw new Exception("Should not get here.");
catch (OverflowException) { }
var n = decimal.MaxValue;
throw new Exception("Should not get here.");
catch (OverflowException) { }
WriteLine("Is int.MaxValue + 1 == int.MinValue? " + (m + 1 == int.MinValue));