public static void assertEquals(String message,float expected,float actual){
  if (expected == actual)   return;
  final int maxUlps=10;
  int ulps=getUlps(expected,actual);
  if (ulps <= maxUlps) {
    return;
  }
  fail("Expecting " + expected + ", not "+ actual+ ": abs(difference)="+ Math.abs(expected - actual)+ ": ulps="+ ulps);
}

public static void assertEquals ( String message , float expected , float actual ) { if ( expected == actual ) return ; final int maxUlps = 10 ; int ulps = getUlps ( expected , actual ) ; if ( ulps <= maxUlps ) { return ; } fail ( "Expecting " + expected + ", not " + actual + ": abs(difference)=" + Math . abs ( expected - actual ) + ": ulps=" + ulps ) ; }
provides a proper basis for comparing floating point numbers ( the values must be within 10 ulps of one another ) .
