简单实用算法—获取分页总页码

变量定义:

  • total:总记录数
  • size:每页记录数
  • result:分页总页码

算法代码:

result=(total-1)/size+1

常用方法:

result=math.ceiling(total/size)

通俗方法:

result=total/size;
if(total%size!=0)result++;
原文地址:https://www.cnblogs.com/timefiles/p/AlgorithmGetPages.html