public static double nextDown(double d) {
        if (Double.isNaN(d) || d == Double.NEGATIVE_INFINITY) {
            return d;
        } else {
            if (d == 0.0f) {
                return -Float.MIN_VALUE;
            } else {
                return Double.longBitsToDouble(Double.doubleToRawLongBits(d) + ((d > 0.0f) ? -1 : +1));
            }
        }
    }
Returns next smaller float value considering precision of the argument.
hellocharts-library/src/lecho/lib/hellocharts/util/FloatUtils.java