Some way to make a Math.floorDiv(a, b); and return the floor division of two BigInteger values
An example:
BigInteger big0 = new BigInteger("10");
BigInteger big1 = new BigInteger("20");
Math.floorDiv(big0, big1);
Switch to BigDecimal and you can control rounding. A scale of 0 means the results are rounded to an integer and FLOOR rounds towards negative infinity.
big0.divide(big1, 0, RoundingMode.FLOOR)
(If you construct big0 from an int, long, or BigInteger then its scale will already be 0 and you can omit the middle argument.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With