Java.math.BigDecimal Class Java.math.BigDecimal.divideToIntegralValue() Method - Java.math Package

What is Java math BigDecimal divideToIntegralValue() Method?


The java.math.BigDecimal.divideToIntegralValue(BigDecimal divisor) returns a BigDecimal whose price is the integer part of the quotient (this / divisor) rounded down. The desired scale of the result is (this.scale() - divisor.scale()).


Following is the declaration for java.math.BigDecimal.divideToIntegralValue() technique.


Divisor − value by which this BigDecimal is to be divided.

Return Value

This technique returns the integer part of this / divisor.


ArithmeticException − If divisor == 0.


The following example shows the usage of math.BigDecimal.divideToIntegralValue()technique.

Let us compile and run the above program, this will produce the following result −

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd Protection Status

Java.math Package Topics