You know how you can't store 1/3 in decimal. (I think I learnt that in primary school)
Same case with 1/10 to binary.
Discussion Over. How does this story have any up votes?
Same case with 1/10 to binary.
Discussion Over. How does this story have any up votes?
A lot of people, when they're starting out, have no idea how computers store digits. I can easily store 1/3 in decimal - 0.3 with a bar over the 3. But, as the article points out, computers don't store bars.
But did you learn that on the first day that you sat down at a computer?
http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.ht...
(There's no need to be aggressive about it!)
The article opens with a good summary of the problem:
Questions [about floating point issues] are asked every day, on online forums like stackoverflow.com.
The answer is that most decimals have infinite representations in binary.I even had Ph.D. TAs in college with the same attitude.
Unbelievable.