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

What is Java math BigDecimal divideToIntegralValue() Method?

Description

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()).

Declaration

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

Parameters

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

Return Value

This technique returns the integer part of this / divisor.

Exception

ArithmeticException − If divisor == 0.

Example

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 DMCA.com Protection Status

Java.math Package Topics