question: private static double roundUp ( final double val ) { int exponent = ( int ) Math . floor ( Math . log10 ( val ) ) ; double rval = val * Math . pow ( 10 , - exponent ) ; if ( rval > 5.0 ) { rval = 10.0 ; } else if ( rval > 2.0 ) { rval = 5.0 ; } else if ( rval > 1.0 ) { rval = 2.0 ; } rval *= Math . pow ( 10 , exponent ) ; return rval ; }
target:  Given a number, round up to the nearest power of ten times 1, 2, or 5.