It's Autumn! Prices fall like leaves! - hours only!Up to 80% off on all courses and bundles.-Close
Introduction
4. Displaying decimal numbers
Text values
Variables
Functions
Summary

Instruction

Good job! If you are observant, you may have noticed that R truncated the result of the previous exercise by one digit. The accurate result for 62*2.20462 is:

136.68644

What R actually displayed was:

136.6864

What happened? By default R displays up to 7 digits (before and after the decimal point) of the result. The accurate result was 8 digits. R truncated it by removing the last digit.

Note that this only applies when R displays a result. When performing the calculations, R works accurately with numbers that have up to 15 decimal places and doesn't perform rounding in intermediate stages.

Exercise

Click Next Exercise to continue.