一、取整函数 Math.ceil(double x):向上取整,并以double类型返回;Math.floor(double x):向下取整,并以double类型返回;Math.rint(double x):取距离x最近的整数,若相等则返回偶数,以double类型返回;Math.rount(x):若x为float类型,返回(int)Math.floor(x+0.5); 若x为double类型,返回(long)Math.floor(x+0.5);