Flash cards
Review the key moves
1/4
Core idea
What is the main idea behind Java Math ceil() Method?
Lesson checks
Practice each idea before moving on
Short Mimo-style checks built from this lesson's code, terms, and sequence.
1Quick choice
Which statement best captures the main point of this lesson?
2Fill blank
Complete the missing token from the example code.
___.out.println(Math.ceil(0.60));3Order
Put the learning moves in the order that makes the concept easiest to apply.
The ceil() method rounds a number UP to the nearest integer.
Definition and Usage
Java Math ceil() Method
❮ Math Methods
Example
System.out.println(Math.ceil(0.60));
System.out.println(Math.ceil(0.40));
System.out.println(Math.ceil(5));
System.out.println(Math.ceil(5.1));
System.out.println(Math.ceil(-5.1));
System.out.println(Math.ceil(-5.9));Definition and Usage
The ceil() method rounds a number UP to the nearest integer.
Tip
To round a number DOWN to the nearest integer, look at the floor() method.
Tip
To round a number to the nearest integer in either direction, look at the round() method.
Syntax
public static double ceil(double
number )Parameter Values
| Parameter | Description |
|---|---|
| number | Required. A number to round up. |
Technical Details
| Returns: | A double value representing the nearest integer greater or equal to a number. |
|---|---|
| Java version: | Any |