Here you can find the source of divide(BigDecimal v1, BigDecimal v2)
public static BigDecimal divide(BigDecimal v1, BigDecimal v2)
//package com.java2s; import java.math.BigDecimal; public class Main { public static BigDecimal divide(String v1, String v2) { return divide(new BigDecimal(v1), new BigDecimal(v2)); }// w w w . ja v a 2 s. c om public static BigDecimal divide(double v1, double v2) { return divide(new BigDecimal(v1), new BigDecimal(v2)); } public static BigDecimal divide(BigDecimal v1, BigDecimal v2) { return divide(v1, v2, 2, BigDecimal.ROUND_HALF_UP); } public static BigDecimal divide(BigDecimal v1, BigDecimal v2, int scale, int roundingMode) { return v1.divide(v2, scale, roundingMode); } }