Tag Archives: unchecked

See how much time a checked block takes in C#

The post Control overflow behavior with checked and unchecked in C# explains how to use checked blocks to watch for integer overflow. If you don’t use checked, the program may encounter integer overflow errors without you knowing it. It seems … Continue reading

Posted in calculations, mathematics, performance, syntax | Tagged , , , , , , , , , , , , , , , | Leave a comment

Control overflow behavior with checked and unchecked in C#

C# handles overflow with different data types differently. You can control this to some extent with the checked and unchecked keywords. If you execute code inside a checked block and an int or long operation causes an overflow, the block … Continue reading

Posted in calculations, mathematics, syntax | Tagged , , , , , , , , , , , , , | 1 Comment