c# 根据总条数,获取页数Math.Ceiling的灵活使用

         
            // 摘要:
            //     返回大于或等于指定的双精度浮点数的最小整数值。
            //
            // 参数:
            //   a:
            //     一个双精度浮点数。
            //
            // 返回结果:
            //     大于或等于 a 的最小整数值。 如果 a 等于 System.Double.NaN、System.Double.NegativeInfinity 或 System.Double.PositiveInfinity,则返回该值。
            //     请注意,此方法返回 System.Double,而不是整数类型。
            Int32 pageNum = (int)Math.Ceiling(12 / (double)10);

posted @ 2020-05-28 10:03  低调码农哥!  阅读(992)  评论(0编辑  收藏  举报