YouTip LogoYouTip

Number Ceil

# Java ceil() Method [![Image 3: Java Number Class](#)Java Number Class](#) * * * The ceil() method rounds a number up, returning a value greater than or equal to the given parameter, of type double. ### Syntax The method has the following syntax formats: double ceil(double d)double ceil(float f) ### Parameters * A primitive data type of type double or float. ### Return Value Returns a double value that is greater than or equal to the given parameter. ## Example public class Test{public static void main(String args[]){double d = 100.675; float f = -90; System.out.println(Math.ceil(d)); System.out.println(Math.ceil(f)); System.out.println(Math.floor(d)); System.out.println(Math.floor(f)); }} Compile and run the above program, the output result is: 101.0-90.0100.0-90.0 * * Java Number Class](#)
← Vue3 RoutingAtt Img Loading β†’