Arithmetic: overflow | ||||||||||||||
So far, we have always assumed that we have enough bits to represent a value. | ||||||||||||||
However, a computer must work with a finite number of bits. | ||||||||||||||
What happens if the result doesn't fit in the available bits? | ||||||||||||||
This is called overflow. | ||||||||||||||
Overflow occurs when the result of an operation is greater than the max possible value | ||||||||||||||
or less than the min value. | ||||||||||||||