Java BigDecimal Divide divide(BigDecimal numerator, BigDecimal denominator)

Here you can find the source of divide(BigDecimal numerator, BigDecimal denominator)

Description

divide

License

Open Source License

Declaration

public static BigDecimal divide(BigDecimal numerator, BigDecimal denominator) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.math.BigDecimal;
import java.math.MathContext;

public class Main {
    private static MathContext context = MathContext.DECIMAL32;

    public static BigDecimal divide(BigDecimal numerator, BigDecimal denominator) {
        return numerator.divide(denominator, context);
    }// ww  w .  j a v  a  2 s  .co m

    public static BigDecimal divide(BigDecimal numerator, int denominator) {
        return divide(numerator, BigDecimal.valueOf(denominator));
    }

    public static BigDecimal divide(BigDecimal numerator, double denominator) {
        return divide(numerator, BigDecimal.valueOf(denominator));
    }

    public static BigDecimal divide(int numerator, int denominator) {
        return divide(BigDecimal.valueOf(numerator), denominator);
    }
}

Related

  1. divide(BigDecimal dividend, BigDecimal divisor, int scale)
  2. divide(BigDecimal left, BigDecimal right)
  3. divide(BigDecimal num1, BigDecimal num2, int scale, int mode)
  4. divide(BigDecimal num1, BigDecimal num2, int scale, int roundingMode)
  5. divide(BigDecimal number1, BigDecimal number2, int decimalPlaces)
  6. divide(BigDecimal one, BigDecimal another)
  7. divide(BigDecimal op1, int op2, int precision)
  8. divide(BigDecimal v1, BigDecimal v2)
  9. divide(final BigDecimal amount, final BigDecimal divideBy, final int scale)