Here you can find the source of div(BigDecimal val, long divisor)
public static BigDecimal div(BigDecimal val, long divisor)
//package com.java2s; //License from project: Open Source License import java.math.BigDecimal; import java.math.RoundingMode; public class Main { protected static final int PRECISION = 100; public static BigDecimal div(long val, long divisor) { return div(bd(val), divisor); }//from ww w. j a v a2 s .c om public static BigDecimal div(BigDecimal val, long divisor) { return div(val, bd(divisor)); } public static BigDecimal div(BigDecimal val, BigDecimal divisor) { return val.divide(divisor, PRECISION, RoundingMode.HALF_UP); } public static BigDecimal bd(long val) { return BigDecimal.valueOf(val); } public static BigDecimal bd(double val) { return BigDecimal.valueOf(val); } }