向上取整Math.ceil()

ZHOU_VIP發表於2018-09-23
public class test {
	
	public static void main(String[] args) {
		int count = 121;
		int pagesize = 10;
		double a = count/(double)pagesize;
		System.out.println("a="+a);
		int b = (int) Math.ceil(a);
		System.out.println(b);
	}

}

a=12.1
13

 

相關文章