Quoted from Effective Java - Second Edition by Joshua Bloch
For floating-point fields, use Double.compare or Float.compare in place of the relational operators, which do not obey the general contract for compareTo when applied to floating point values.
It doesn't elaborate on why this is the case.
So, my question is:
In what way do relational operators fail to obey the general contract for compareTo when used with floating point values?