ceil() Method in java

Java Programming Language Number Class in java (Article) Number Class in java (Program)

833

Program:

public class WrapperceilMethod {

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

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

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

/*

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

*/

Output:

-170.0
-190.0
-171.0
-190.0
Press any key to continue . . .

This Particular section is dedicated to Programs only. If you want learn more about Java Programming Language. Then you can visit below links to get more depth on this subject.