Here you can find the source of ceil(BigDecimal x)
public static BigInteger ceil(BigDecimal x)
//package com.java2s; //License from project: Open Source License import java.math.BigDecimal; import java.math.BigInteger; import java.math.RoundingMode; public class Main { public static BigInteger ceil(BigDecimal x) { return x.setScale(0, RoundingMode.CEILING).unscaledValue(); }/*from w ww . ja v a 2s. c o m*/ }