code: public static float ulp(float x) {
          if (Float.isInfinite(x)) {
              return Float.POSITIVE_INFINITY;
          }
          return abs(x - Float.intBitsToFloat(Float.floatToIntBits(x) ^ 1));
      }
docs: Compute least significant bit (Unit in Last Position) for a number.
  @param x number from which ulp is requested
  @return ulp(x)