4.5.4.9 Underflow and overflow Flashcards
What is overflow?
The result of a calculation is too large to store/represent in the available number of bits / storage space
When might overflow occur?
Multiplying two numbers together;
Dividing a number by a number less than one / small number;
What is underflow?
When a number or the result of an equation is too small to represent in the available bits.
When might underflow occur?
adding two negative numbers
Usually occurs when a very small number is subtracted from a very large number, or a large number is divided by a much larger number.
What is a cancellation error?
Loss of significance is an undesirable effect in calculations. It occurs when an operation on two numbers increases relative error substantially more than it increases absolute error, for example in subtracting two nearly equal numbers (known as catastrophic cancellation). The effect is that the number of significant digits in the result is reduced unacceptably.
When might cancellation occur?
Adding together two numbers of very different
sizes e.g. a tiny number to a very big number