The ceil() method rounds the specified double value upward and returns it. The rounded value will be equal to the mathematical integer. That is, the value 3.24 will be rounded to 4.0 which is equal to integer 4.
Example
Syntax of Math.ceil()
The syntax of the ceil() method is:
Math.ceil(double value)
Here, ceil() is a static method. Hence, we are accessing the method using the class name, Math.
ceil() Parameters
The ceil() method takes a single parameter.
- value - number which is to be rounded upward
ceil() Return Value
- returns the rounded value that is equal to the mathematical integer
Note: The returned value will be the smallest value that is greater than or equal to the specified argument.