175 views
5 votes
What are some key things to keep in mind with int, float and double representation?

User DonMag
by
6.9k points

1 Answer

3 votes

Final answer:

When working with int, float, and double representations, it is important to keep in mind the rules about significant figures and rounding. Addition and subtraction have rules about decimal places, while multiplication and division have rules about significant figures.

Step-by-step explanation:

When working with int, float, and double representations, it is important to keep in mind the rules about significant figures and rounding. In addition, there are certain rules to follow for addition and subtraction, as well as multiplication and division, when it comes to decimal places and significant figures. For addition and subtraction, the answer should have the same number of decimal places as the number with the smallest number of decimal places in the original numbers. For example, 13.2 + 12.252 = 25.452 should be rounded to 25.5 to keep one decimal place. For multiplication and division, the answer should have the same number of significant figures as the original number with the smallest number of significant figures. For example, 1.35 x 2.1 = 2.835 should be rounded to 2.8.

User Oomph Sonar
by
8.4k points