public BigDecimal[] divideAndRemainder (BigDecimal divisor, MathContext mc)

Returns a two-element BigDecimal array containing the result of divideToIntegralValue followed by the result of remainder on the two operands calculated with rounding according to the context settings.

Note that if both the integer quotient and remainder are needed, this method is faster than using the divideToIntegralValue and remainder methods separately because the division need only be carried out once.

Parameters:
divisor    value by which this BigDecimal is to be divided, and the remainder computed.
mc    the context to use.

Returns:  a two element BigDecimal array: the quotient (the result of divideToIntegralValue) is the initial element and the remainder is the final element.

Exceptions:
ArithmeticException    if divisor==0
ArithmeticException    if the result is inexact but the rounding mode is UNNECESSARY, or mc.precision > 0 and the result of this.divideToIntgralValue(divisor) would require a precision of more than mc.precision digits.

See also:
divideToIntegralValue(java.math.BigDecimal, java.math.MathContext), remainder(java.math.BigDecimal, java.math.MathContext)

Since:  1.5