9 April 2021 by Phillip Johnston • Last updated 14 December 2021 This entry was contributed Nathan Jones. Thanks Nathan! Integer underflows and overflows are a common computational error that occurs in computer systems. These error conditions are often not explicitly checked for by developers. Ignoring the possibility of overflows or underflows can have disastrous results. Basic Overview Integer overflow occurs when the result of a math operation is too large to fit into the result variable’s data type. For example, the code below overflows if a = INT_MAX and b = 1. int add( int a, int b) { …
Continue reading “Integer Underflow and Overflow”
