java math.ceil
Math.ceil(125.9)=126.0
Math.ceil(0.4873)=1.0
Math.ceil(-0.65)=-0.0
4
9
Math.ceil(value);
Thank you!
9
0
0
9
import java.lang.*;
public class Math {
public static void main(String[] args) {
// get two double numbers
double x = 125.9;
double y = 0.4873;
// call ceal for these these numbers
System.out.println("Math.ceil(" + x + ")=" + Math.ceil(x));
System.out.println("Math.ceil(" + y + ")=" + Math.ceil(y));
System.out.println("Math.ceil(-0.65)=" + Math.ceil(-0.65));
}
}
Thank you!
9
0
4.33
3
The ceiling of a floating point number is the smallest integer that is >= to the number.
Thank you!
3
0
3.63
8
import java.lang.Math;
Math.ceil(a);
Thank you!
8
0
Are there any code examples left?
New code examples in category Java