KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
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 this really the best way? int x = foo(); int test = x * common; if(test / common != x) Console.WriteLine("oh noes!"); else Console.WriteLine("safe!");
Tags (comma-separated)
Save Edits
Cancel