Code example for BigDecimal

Methods: divide

public BigDecimal decimalValue(){
	return decimalValue(MathContext.UNLIMITED);
public BigDecimal decimalValue(MathContext mc){
	BigDecimal numerator = new BigDecimal(this.numerator);
	BigDecimal denominator = new BigDecimal(this.denominator);
	return numerator.divide(denominator, mc);
public BigInteger bigIntegerValue(){
	return numerator.divide(denominator);
public int compareTo(Object o){
	Number other = (Number)o;
	return, other);
Connect your IDE to all the code out there  Get Codota for Java