When in Java I compare (1.0d == 1.0d - Double.MIN_VALUE), it returns true even though while very close in reality 1.0d should be greater than (1.0d - Double.MIN_VALUE).
If I use Double.compare(1.0d, 1.0d - Double.MIN_VALUE), it returns 0. Meaning those two values are equal.
When I print Double.doubleToLongBits(), the same value is printed for both 1.0 and 1.0d - Double.MIN_VALUE.
The same happens if I use Double.MIN_NORMAL too.
Why does this happen? What can I do to make the comparison return the proper result?
Thanks!