Extensions for java.math.BigInteger

Platform and version requirements: JVM (1.2)

and

Performs a bitwise AND operation between the two values.

infix fun BigInteger.and(other: BigInteger): BigInteger
Platform and version requirements: JVM (1.2)

dec

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

operator fun BigInteger.dec(): BigInteger
Platform and version requirements: JVM (1.0)

div

Enables the use of the / operator for BigInteger instances.

operator fun BigInteger.div(other: BigInteger): BigInteger
Platform and version requirements: JVM (1.2)

inc

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

operator fun BigInteger.inc(): BigInteger
Platform and version requirements: JVM (1.2)

inv

Inverts the bits including the sign bit in this value.

fun BigInteger.inv(): BigInteger
Platform and version requirements: JVM (1.0)

minus

Enables the use of the - operator for BigInteger instances.

operator fun BigInteger.minus(other: BigInteger): BigInteger
Platform and version requirements: JVM (1.2)

or

Performs a bitwise OR operation between the two values.

infix fun BigInteger.or(other: BigInteger): BigInteger
Platform and version requirements: JVM (1.0)

plus

Enables the use of the + operator for BigInteger instances.

operator fun BigInteger.plus(other: BigInteger): BigInteger
Platform and version requirements: JVM (1.1)

rem

Enables the use of the % operator for BigInteger instances.

operator fun BigInteger.rem(other: BigInteger): BigInteger
Platform and version requirements: JVM (1.2)

shl

Shifts this value left by the n number of bits.

infix fun BigInteger.shl(n: Int): BigInteger
Platform and version requirements: JVM (1.2)

shr

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

infix fun BigInteger.shr(n: Int): BigInteger
Platform and version requirements: JVM (1.0)

times

Enables the use of the * operator for BigInteger instances.

operator fun BigInteger.times(other: BigInteger): BigInteger
Platform and version requirements: JVM (1.2)

toBigDecimal

Returns the value of this BigInteger number as a BigDecimal.

fun BigInteger.toBigDecimal(): 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.

fun BigInteger.toBigDecimal(
    scale: Int = 0, 
    mathContext: MathContext = MathContext.UNLIMITED
): BigDecimal
Platform and version requirements: JVM (1.0)

unaryMinus

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

operator fun BigInteger.unaryMinus(): BigInteger
Platform and version requirements: JVM (1.2)

xor

Performs a bitwise XOR operation between the two values.

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

© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/java.math.-big-integer/index.html