What is the Difference Between Truncation and Rounding?

Truncation is a method of approximating numbers that is simpler than rounding, but it does not always provide the most accurate approximation of the original number. Learn more about how truncation and rounding differ in computation.

What is the Difference Between Truncation and Rounding?

Truncation is a method of approximating numbers that is simpler than rounding, but it does not always provide the most accurate approximation of the original number. It is used in computation when division is done with integers and the answer must be an integer. For example, if you were to truncate 63,854 and 0.04988 to 3 significant figures, you would get 63,000 and 0.049 respectively. The algorithm of subtracting 0.5 from a value and then rounding it (which truncates a positive number) is so useful that Java has included a method in its standard library to do it for you.

Note that the domains of the truncation function and the rounding function for any given return value are offset by exactly 0.5.The algorithm for truncating positive numbers (and the really motivated ones can find an algorithm to truncate negative numbers) is to omit all digits after the first 3 significant digits (the first non-zero digit and the next two digits). Unlike the algorithm that takes a positive float and truncates it to an int value, the floor function receives and returns a double value (you can confirm this in the Java class documentation). When Excel is truncated, it trims part of the entered number and does not perform any rounding. To learn more about using rounding and truncation, go to Excel Help.

Charlotte Wilson
Charlotte Wilson

Friendly travel advocate. Freelance zombie scholar. Extreme web practitioner. Evil coffee buff. Professional beer practitioner.

Leave Reply

Required fields are marked *