Java Number Divide div(double a, double b, int len)

Here you can find the source of div(double a, double b, int len)

Description

div

License

Open Source License

Declaration

public static Double div(double a, double b, int len) 

Method Source Code


//package com.java2s;
import java.math.BigDecimal;

public class Main {

    public static Double div(double a, double b, int len) {
        BigDecimal bdA = new BigDecimal(a);
        BigDecimal bdB = new BigDecimal(b);

        return bdA.divide(bdB, len, BigDecimal.ROUND_HALF_UP).doubleValue();
    }//from w  w  w .  j  a v  a  2 s  .co  m
}

Related

  1. div(Class clazz, T a, T b)
  2. div(double operand1, double operand2)
  3. div(double v1, double v2)
  4. div(Double v1, Double v2)
  5. div(Double v1, Double v2)