Java 两个数相除,只要有小数就入一位,不舍去,即为向上去整

向上取整用Math.ceil(double a) 向下取整用Math.floor(double a) 例如: System.out.println(Math.ceil(1.21)); System.out.println(Math.ceil(1.21)); 结果: 2.0; 1.0;
相关文章
相关标签/搜索