1 00:00:00,300 --> 00:00:03,120 The problem here, is that the computer, works 2 00:00:03,120 --> 00:00:05,250 internally in a different number system called the 3 00:00:05,250 --> 00:00:08,870 binary number system, and there's no exact representation 4 00:00:08,870 --> 00:00:11,890 for 4.35 in that system. It's kind of 5 00:00:11,890 --> 00:00:15,738 similar to your pocket calculator. When you divide 6 00:00:15,738 --> 00:00:18,398 ten by three, you get 3.3333 and so 7 00:00:18,398 --> 00:00:21,766 on. And then when you multiply again with 8 00:00:21,766 --> 00:00:24,630 three, you would get 9.999999 and so on. 9 00:00:27,200 --> 00:00:29,700 And the reason is that there is no 10 00:00:29,700 --> 00:00:32,659 exact representation for the fraction ten over three 11 00:00:32,659 --> 00:00:35,640 in the decimal system. Now as programmers, we 12 00:00:35,640 --> 00:00:39,560 don't usually worry about the detail reasons why these 13 00:00:39,560 --> 00:00:42,160 round of errors occur, we just have the 14 00:00:42,160 --> 00:00:45,480 general intuition that floating point numbers are a little 15 00:00:45,480 --> 00:00:47,890 bit fuzzy. Just like the fuzzy photo over 16 00:00:47,890 --> 00:00:52,240 here, you can't quite rely on every last pixel. 17 00:00:52,240 --> 00:00:55,330 So when you get a number like 434.999 and 18 00:00:55,330 --> 00:00:58,250 so on, that's just something we have to deal with. 19 00:00:58,250 --> 00:00:59,750 Now, in this case, if we don't want to 20 00:00:59,750 --> 00:01:04,150 lose any pennies, the remedy would be to use integers 21 00:01:04,150 --> 00:01:07,620 and work in pennies. If this had been 435 22 00:01:07,620 --> 00:01:11,700 pennies as an integer, a 100 times 435 would not 23 00:01:11,700 --> 00:01:14,800 have been a problem. There are several other number 24 00:01:14,800 --> 00:01:17,300 types in Java that you may need in more technical 25 00:01:17,300 --> 00:01:20,920 situations, we've prepared a fact sheet for you. Go ahead, read through 26 00:01:20,920 --> 00:01:24,840 the worksheet, and then work with Sarah on a few quiz questions