div

open operator override fun div(divisor: BigDecimal): BigDecimal

Returns a BigDecimal whose value is (this / divisor), and whose preferred _scale is (this._scale() - divisor._scale()); if the exact quotient cannot be represented (because it has a non-terminating decimal expansion) an ArithmeticException is thrown.

Return

this / divisor

Since

1.5

Author

Joseph D. Darcy

Parameters

divisor

value by which this BigDecimal is to be divided.

Throws

if the exact quotient does not have a terminating decimal expansion


open override fun div(divisor: BigDecimal, mc: MathContext): BigDecimal

Returns a BigDecimal whose value is (this / divisor), with rounding according to the context settings.

Return

this / divisor, rounded as necessary.

Since

1.5

Parameters

divisor

value by which this BigDecimal is to be divided.

mc

the context to use.

Throws

if the result is inexact but the rounding mode is UNNECESSARY or mc._precision == 0 and the quotient has a non-terminating decimal expansion.