public static double getRound(double speed, double value)
    {
        if (speed < 0)
        {
            return Math.floor(value);
        }
        return Math.ceil(value);
    }
public static double getRound ( double speed , double value ) { if ( speed < 0 ) { return Math . floor ( value ) ; } return Math . ceil ( value ) ; }
Get the rounded floor or ceil value depending of the speed.

@param speed The speed value.
@param value The value to round.
@return The floor value if negative speed, ceil if positive speed.