The Math.ulp () method has practical application in testing. As you undoubtedly know, you usually should not compare floating point numbers for exact equality. Instead, you verify that they are equal within a certain tolerance. For example, in JUnit, you are comparing expected actual floating point values, for example:
assertEquals(expectedValue, actualValue, 0.02);
, 0,02 . 0,02 ? 10,5 -107,82, 0,02, , . , , 0.02 . , , ULP. , , 1 10 ULP. , , 5 ULP :
assertEquals(expectedValue, actualValue, 5*Math.ulp(expectedValue));
http://www.ibm.com/developerworks/java/library/j-math2/index.html