public static float ulp(final float value){
  if (USE_JDK_MATH) {
    return Math.ulp(value);
  }
  final int exponent=getExponent(value);
  if (exponent >= MIN_FLOAT_NORMAL_EXPONENT + 23) {
    if (exponent == MAX_FLOAT_EXPONENT + 1) {
      return Math.abs(value);
    }
    return Float.intBitsToFloat(exponent + MAX_FLOAT_EXPONENT - 23 << 23);
  }
 else {
    if (exponent == MIN_FLOAT_NORMAL_EXPONENT - 1) {
      return Float.MIN_VALUE;
    }
    return Float.intBitsToFloat(1 << exponent - MIN_FLOAT_NORMAL_EXPONENT);
  }
}

public static float ulp ( final float value ) { if ( USE_JDK_MATH ) { return Math . ulp ( value ) ; } final int exponent = getExponent ( value ) ; if ( exponent >= MIN_FLOAT_NORMAL_EXPONENT + 23 ) { if ( exponent == MAX_FLOAT_EXPONENT + 1 ) { return Math . abs ( value ) ; } return Float . intBitsToFloat ( exponent + MAX_FLOAT_EXPONENT - 23 << 23 ) ; } else { if ( exponent == MIN_FLOAT_NORMAL_EXPONENT - 1 ) { return Float . MIN_VALUE ; } return Float . intBitsToFloat ( 1 << exponent - MIN_FLOAT_NORMAL_EXPONENT ) ; } }
the ulp ( unit in the last place ) is the distance to the next value larger in magnitude .
