Java examples for Language Basics:Math
Math.ceil method returns the smallest interger which is not less than the value.
public class Main { public static void main(String[] args) { System.out.println(Math.ceil(101)); System.out.println(Math.ceil(101.1)); //from w ww. j a v a 2 s .c om System.out.println(Math.ceil(5.5)); System.out.println(Math.ceil(-20)); System.out.println(Math.ceil(-421.4)); System.out.println(Math.ceil(0)); } }