Why would you not use "checked"?

  • Thread starter Thread starter Brett
  • Start date Start date
B

Brett

Why would you not want to use checked on any type of mathematical operation?

Or use unchecked for that matter?

Thanks,
Brett
 
Brett said:
Why would you not want to use checked on any type of mathematical
operation?

There are some algorithms that actually use the overflow (rely on it to
happen). I think I've seen this done in an integer random number generator.
 
Michael A. Covington said:
There are some algorithms that actually use the overflow (rely on it to
happen). I think I've seen this done in an integer random number generator.

In addition to which, I believe unchecked operation can be
significantly faster - it could make a huge difference in an app which
is heavy on calculations.
 
Why would you not want to use checked on any type of mathematical operation?

Or use unchecked for that matter?

Thanks,
Brett

Unchecked effectively does a modulus operation for free. This is
useful in some mathematical applications.

rossum


The ultimate truth is that there is no ultimate truth
 
Back
Top