KBigInteger

class KBigInteger(val signum: Int, val magnitude: IntArray) : Comparable<KBigInteger>

arbitrary-precision integer arithmetic. Pure Kotlin implementation.

Constructors

Link copied to clipboard
constructor(signum: Int, magnitude: IntArray)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
val signum: Int

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns the bitwise AND of this value and other. (this & other)

Link copied to clipboard

Infix function for bitwise AND.

Link copied to clipboard

Returns the bitwise AND NOT of this value and other. (this & ~other)

Link copied to clipboard
open operator override fun compareTo(other: KBigInteger): Int
Link copied to clipboard
operator fun KBigInteger.div(other: KBigInteger): KBigInteger

Division operator for KBigInteger.

Link copied to clipboard
Link copied to clipboard

Returns both quotient and remainder in a single operation. More efficient than calling divide() and mod() separately.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Subtraction operator for KBigInteger.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns the bitwise NOT of this value. ~x = -x - 1

Link copied to clipboard

Returns the bitwise OR of this value and other. (this | other)

Link copied to clipboard

Infix function for bitwise OR.

Link copied to clipboard
operator fun KBigInteger.plus(other: KBigInteger): KBigInteger

Addition operator for KBigInteger.

Link copied to clipboard
fun pow(exponent: Int): KBigInteger

Calculates this KBigInteger raised to the power of the specified integer exponent. Uses binary exponentiation for efficiency.

Link copied to clipboard
operator fun KBigInteger.rem(other: KBigInteger): KBigInteger

Remainder operator for KBigInteger.

Link copied to clipboard
infix fun shl(n: Int): KBigInteger
Link copied to clipboard
infix fun shr(n: Int): KBigInteger
Link copied to clipboard
fun signum(): Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Multiplication operator for KBigInteger.

Link copied to clipboard
fun toLong(): Long

Converts this KBigInteger to a Long value.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard

Unary minus operator for KBigInteger.

Link copied to clipboard

Unary plus operator for KBigInteger (identity operation).

Link copied to clipboard

Returns the bitwise XOR of this value and other. (this ^ other)

Link copied to clipboard

Infix function for bitwise XOR.