import java.math.BigDecimal;
import java.lang.Math;
public class MathCeilExample {
public static void main(String[] args) {
double number = 4.3;
double result = Math.ceil(number);
System.out.println("The ceiling of " + number + " is " + result);
// Explanation:
// Math.ceil() is a method in Java that returns the smallest (closest to negative infinity)
// double value that is greater than or equal to the argument and is equal to a mathematical integer.
// In this example, the ceiling of 4.3 is 5.0.
}
}
下一篇:java修饰符
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站