For comparison of equality between floating point numbers, it is preferred to see the closeness of the numbers because of the internal representation of floating point numbers in the computer. You might have to check if the numbers are in epsilon
distance of each other.The result of equality comparison depends on the particular compiler/machine.
Maybe you could look at this for more details: http://www.parashift.com/c++-faq/floating-point-arith.html