Extensions for java.math.BigInteger

and

infix fun BigInteger.and(other: BigInteger): BigInteger

Performs a bitwise AND operation between the two values.

dec

operator fun BigInteger.dec(): BigInteger

Enables the use of the -- operator for BigInteger instances.

div

operator fun BigInteger.div(other: BigInteger): BigInteger

Enables the use of the / operator for BigInteger instances.

inc

operator fun BigInteger.inc(): BigInteger

Enables the use of the ++ operator for BigInteger instances.

inv

Inverts the bits including the sign bit in this value.

minus

operator fun BigInteger.minus(other: BigInteger): BigInteger

Enables the use of the - operator for BigInteger instances.

or

infix fun BigInteger.or(other: BigInteger): BigInteger

Performs a bitwise OR operation between the two values.

plus

operator fun BigInteger.plus(other: BigInteger): BigInteger

Enables the use of the + operator for BigInteger instances.

rem

operator fun BigInteger.rem(other: BigInteger): BigInteger

Enables the use of the % operator for BigInteger instances.

shl

infix fun BigInteger.shl(n: Int): BigInteger

Shifts this value left by the n number of bits.

shr

infix fun BigInteger.shr(n: Int): BigInteger

Shifts this value right by the n number of bits, filling the leftmost bits with copies of the sign bit.

times

operator fun BigInteger.times(other: BigInteger): BigInteger

Enables the use of the * operator for BigInteger instances.

toBigDecimal

fun BigInteger.toBigDecimal(): BigDecimal

Returns the value of this BigInteger number as a BigDecimal.

fun BigInteger.toBigDecimal(
    scale: Int = 0,
    mathContext: MathContext = MathContext.UNLIMITED
): BigDecimal

Returns the value of this BigInteger number as a BigDecimal scaled according to the specified scale and rounded according to the settings specified with mathContext.

unaryMinus

operator fun BigInteger.unaryMinus(): BigInteger

Enables the use of the unary - operator for BigInteger instances.

xor

infix fun BigInteger.xor(other: BigInteger): BigInteger

Performs a bitwise XOR operation between the two values.