Without reading your code, I am guessing it's because floating point numbers don't have infinite precision. Not all floating point numbers can be represented with infinite precision, so when you type in 2.6, it's possible that 2.60000001 or 2.599999999 is stored instead.
You will have to do something like this:
Code:
const int EPSILON = 0.000001; /* a small number. error threshold */
...
if (num < (0.6-EPSILON)) {
...
}
It is indeed redundant, and I doubt it is actually what fixes your problem.
Nothing wrong with the compiler. Free software does not have to be inferior to commercial software. The compiler that Dev-C++ uses, GCC, is a state of art compiler, not any worse than commercial compilers.