Code example for BigDecimal

Methods: compareTotoBigIntegerExact

0
            } 
    } 
 
    private BigInteger getIntegerValue(RpnStack values) {
        BigDecimal candidateValue = values.pop();
        if (candidateValue.compareTo(BigDecimal.ZERO) < 0)
            throw new ArithmeticException("Prime Factors undefined for values < 0");
        BigInteger value = candidateValue.toBigIntegerExact();
        return value;
    } 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE