public static float ulp(float x){
  if (Float.isInfinite(x)) {
    return Float.POSITIVE_INFINITY;
  }
  return abs(x - Float.intBitsToFloat(Float.floatToIntBits(x) ^ 1));
}

public static float ulp ( float x ) { if ( Float . isInfinite ( x ) ) { return Float . POSITIVE_INFINITY ; } return abs ( x - Float . intBitsToFloat ( Float . floatToIntBits ( x ) ^ 1 ) ) ; }
compute least significant bit ( unit in last position ) for a number .
