This module demonstrates the effect of different rules for rounding a given decimal number to a smaller number of digits. If a given real number is not exactly representable as a floating-point number, then it must be approximated by some nearby floating-point number, a process called rounding. Two commonly used rounding rules are
Round to nearest is the more accurate of the two, and is the default rounding mode in IEEE floating-point arithmetic.
The user selects values for the input and output precisions, and then either enters explicitly or chooses randomly a value to be rounded. The chosen number is then rounded by clicking the button for the desired rounding rule.
Reference: Michael T. Heath, Scientific Computing, An Introductory Survey, 2nd edition, McGraw-Hill, New York, 2002. See Section 1.3.4, especially Example 1.10.
Developers: Nicholas Exner and Michael Heath