Home » Posts tagged "int"

CSharp Numeric Overflows

NumericOverflowDid you know that when you are dealing with numbers, by default, .NET will do, or try to do exactly what you tell it to do?  If you tell it to do the impossible, it will do the next most logical thing.  It won’t throw any errors in the process.

No, neither did I.  But then, most of the time I don’t write code where this would matter, and I bet you don’t either.

So here are some examples.

Continue reading “CSharp Numeric Overflows”