# Rounding

Rounding a number means replacing it with a different number that is approximately equal to the original, but has a shorter, simpler, or more explicit representation.

For example, the number 2.246 can be expressed with two decimals as 2.25, and the number -1.8 can be rounded to -2 with zero decimals (as an integer). Rounding is often done to obtain a value that is easier to report and communicate than the original.

Rounding can also be important to avoid misleadingly precise reporting of a computed number, measurement or estimate.

There are many types of rounding. For all the questions posed here, we'll use the following rules:

• When rounding to n decimals, if the next decimal digit is greater or equal to 5, the nth digit is rounded up
• When rounding to n decimals, if the next decimal digit is less than 5, the nth digit is left unaltered
• The remaining digits from the nth digit are discarded
• If a number is given as a matemathical expression, it must be computed before rounding

## Examples

The number 4.1293 is rounded to 2 decimals as 4.13 because the 3rd decimal is greater than 5

The number 4.1293 is rounded to 3 decimals as 4.129 because the 4th decimal is less than 5

The number -5.62 is rounded to 0 decimals as -6 because the first decimal is greater than 5

The number is first computed as 14.1421 and then rounded to 1 decimal as 14.1