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 .