向上取整用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;