The Trouble With Rounding Floats
lukfil writes "We all know of floating point numbers, so much so that we reach for them each time we write code that does math. But do we ever stop to think what goes on inside that floating point unit and whether we can really trust it?"
Don't put advice in your sig.
Not exactly. The real problem is that people use decimal numbers, and computers use binary numbers. Each numbering system has some numbers that the other one cannot represent exactly. If computers used floating-point DECIMAL calculations, this would be avoided. I've never seen that done, but I have seen fixed-point decimal, and it usually solves this problem nicely. But modern computers don't do decimal arithmetic as fast as they do binary arithmetic, so it's not used as often as it should be.