Handling integer overflow is a common task, but what\'s the best way to handle it in C#? Is there some syntactic sugar to make it simpler than with other languages? Or is th
Try the following
int x = foo(); try { int test = checked (x * common); Console.WriteLine("safe!"); } catch (OverflowException) { Console.WriteLine("oh noes!"); }