Is arithmetic overflow/underflow generally checked in .Net framework methods?
Posted
by YWE
on Stack Overflow
See other posts from Stack Overflow
or by YWE
Published on 2010-06-09T22:49:20Z
Indexed on
2010/06/09
22:52 UTC
Read the original article
Hit count: 257
c#
For example, let's use the Add method of the ArrayList class. If I am using the default compiler settings in Visual Studio C# project in which arithmetic overflow is not checked, would ArrayList.Add() throw an OverflowException if I added too many items? Would surrounding the method call with checked
or unchecked
make any difference?
BTW, I would write a test program to determine the answer to this question if I had Visual Studio available to me right now.
© Stack Overflow or respective owner