Locked lesson.
About this lesson
In this lesson, we discuss the differences between integers, floats, decimals, and doubles, and how decimal places may be affected based on the data type you choose.
Exercise files
Download this lesson’s related exercise files.
16 - Math Floats Vs. Ints.docx61.1 KB 16 - Math Floats Vs. Ints SOLUTION.docx
57.9 KB
Quick reference
Math Floats Vs. Ints
Integers have no decimal places. If you need decimals, you should use either Float, Decimal, or Double.
When to use
Use these whenever you need to calculate decimal places with your numbers.
Instructions
10 divided by 3 returns:
- Integer: 3
- Float: 3.3333333
- Decimal: 3.333333333333333333333333333
- Double: 3.3333333333335
Hints & tips
- Choose Float, Decimal, or Double based on how specific you want your decimal answer to be.
Lesson notes are only available for subscribers.