상황 게시판 페이징을 구현하던 중에 Math.ceil이 적용되지 않는 문제가 발생했다. ex) int totalPage = (int) Math.ceil(totalItem/itemPerPage); - (x) 해결 Math.ceil함수 안에서 연산을 하면 정수값이 도출돼서 Math.ceil이 적용되지 않는다. 따라서 double타입으로 강제타입변환을 하거나 1.0을 곱해서 소수점이 있는 실수로 만들어줘야 한다. ex) int totalPage = (int) Math.ceil(totalItem*1.0/itemPerPage); - (o) int totalPage = (int) Math.ceil((double)totalItem/itemPerPage); - (o)