Logout

4.1.5 Define truncation error, underflow error, and overflow error.

(No teaching notes for this one.)

Sample Question 1:

Define the term underflow, when used in connection with binary arithmetic. [2 marks]


Sample Question 2:

(g) State the name of the error and explain why this error would occur when
attempting to store the number 1234.34 using a 5-bit mantissa. [2 marks]

JSR Notes:

This is one of those syllabus statements that is taken to greater depth later on, but you still have to have definition at the ready, so here are some straight-forward ones for you:

Truncation error: an error usually resulting from a real value being cast into an integer value; in this case, the decimal portion is simply “lopped off”.  So the Java double 3.14 converted to a Java int would become simply 3.

Underflow error: an error resulting from the inability of a floating-point representation to accurately represent precision beyond a certain decimal place. So 0.0009 attempted to be represented by a floating point number that could generally reach only three decimal places of precision would be represented as 0.000.

Overflow error: an error that occurs when a number is attempted to be that is outside of the magnitude range the data type being used.  For example, if the largest positive number that the Java signed byte type can use is 127, then 128 and above are all outside of the range of numbers that can be used by that data type.