divmod

fun divmod(number: ByteArray, firstDigit: Int, base: Int, divisor: Int): Byte

Divides a number, represented as an array of bytes each containing a single digit in the specified base, by the given divisor. The given number is modified in-place to contain the quotient, and the return value is the remainder.

Author

Marcus Cvjeticanin

Since

0.2.0

Return

the remainder of the division operation

Parameters

number

the number to divide

firstDigit

the index within the array of the first non-zero digit (this is used for optimization by skipping the leading zeros)

base

the base in which the number's digits are represented (up to 256)

divisor

the number to divide by (up to 256)