Overflow and Underflow | ||
Overflow is caused when a number is
too large to be stored accurately in the reserved storage
space. It is usually the result of a numerical calculation. Trivial example : 4-bit (unsigned) integers 6 = 0110 3 = 0011 Multiply the numbers together : 6 * 3 = 18 - which is too big to store as a 4-bit integer (the highest 4-bit integer is 15) 18 = 10010 and would need at least a 5-bit storage space
|
||
Underflow is caused when a number is
too small to be representable in the
storage space reserved.
|
||