Here you can find the source of div(double operand1, double operand2)
public static double div(double operand1, double operand2)
//package com.java2s; import java.math.BigDecimal; public class Main { public static double div(double operand1, double operand2) { return div(operand1, operand2, 10); }// w ww. j a v a 2 s .c o m public static double div(double operand1, double operand2, int scale) { BigDecimal o1 = new BigDecimal(operand1); BigDecimal o2 = new BigDecimal(operand2); return o1.divide(o2, scale, BigDecimal.ROUND_HALF_UP).doubleValue(); } }