Java Number Divide div(double operand1, double operand2)

Here you can find the source of div(double operand1, double operand2)

Description

div

License

Open Source License

Declaration

public static double div(double operand1, double operand2) 

Method Source Code


//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();
    }
}

Related

  1. div(Class clazz, T a, T b)
  2. div(double a, double b, int len)
  3. div(double v1, double v2)
  4. div(Double v1, Double v2)
  5. div(Double v1, Double v2)
  6. div(double v1, double v2)