http://qs321.pair.com?node_id=404070

Q&A > math > My floating point comparison does not work. Why ? - Answer contributed by TedPride

You should also note that while floating point numbers won't be exact, two numbers arrived at through the same calculation (4 / 7, for instance) will be the same. This means that under some conditions, rounding isn't necessary - and under others, a simple fraction class is probably going to be better than trying to approximate comparisons.