Look at the Math class. It has some useful methods.
Also rounding can be done by adding 0.5 and casting to an int.