Here you can find the source of divide(BigDecimal dividend, BigDecimal divisor)
public static BigDecimal divide(BigDecimal dividend, BigDecimal divisor)
//package com.java2s; import static java.util.Objects.requireNonNull; import java.math.BigDecimal; import java.math.RoundingMode; public class Main { public static BigDecimal divide(BigDecimal dividend, BigDecimal divisor) { requireNonNull(dividend);/*from w w w. jav a 2s . c o m*/ requireNonNull(divisor); return dividend.divide(divisor, 4, RoundingMode.HALF_DOWN); } }