WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

Java - ceil() Method


Returns the smallest integer that is greater than or equal to the argument. Returned as a double.

Example

public class Test { 

   public static void main(String args[]) {
      double d = -200.675;
      float f = -10;    

      System.out.println(Math.ceil(d));
      System.out.println(Math.ceil(f)); 

      System.out.println(Math.floor(d));
      System.out.println(Math.floor(f)); 
   }
}
Run example »