I'm trying to understand floating point operations in Java in more detail. If I read the documentation correctly, the following holds for any given double x:
x - Math.ulp(x) == Math.nextAfter(x, Double.NEGATIVE_INFINITY);
x + Math.ulp(x) == Math.nextAfter(x, Double.POSITIVE_INFINITY);
Question: Is this always the case or are there some exceptional cases in which results will differ?