June 2010
Intermediate to advanced
328 pages
7h 51m
English
The integer is a useful data type, but it stores only whole numbers like 1 or 327 or -19. It can’t represent fractional values like 2.5. You need a different data type if you need numbers with more precision than an integer. For example, sums of money are usually represented by numbers with two decimal places, like $19.95.
So, the objective is to store numeric values that aren’t whole numbers and to use them in arithmetic computations. There is an additional objective, although it ought to go without saying: the results of arithmetic computations must be correct.
Read now
Unlock full access