Math.
ceil(double x);

功 能: 返回大于或者等于指定表达式的最小整数,即向上取整


用例:写 分页 的时候要根据查到的记录总数 count 和每页数据数 rows ,求出总共有多少页。这里都定义为 int 型的


public Long getTotalPage() {


this.getRecordCount();
Integer rows = this.getRows();
return count > 0 && rows > 0 ? (int) Math.ceil((double) count / (double) rows) : 0L;
}